Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ContentAnalysis.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#* file
#include "ContentAnalysisIPCTypes#nclude ContentAnalysis.hjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 java.lang.StringIndexOutOfBoundsException: Range [30, 26) out of bounds for length 49

#include "base/process_util.h"
#include "GMPUtils.h"  // ToHexString
#include "MainThreadUtils.h"
#include 
#include "include "nsIGlobalObject.h"
#include "mozilla/dom/CanonicalBrowsingContext.h"
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/Directory.h"
#include "mozilla/dom/DragEvent.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/WindowGlobalParent.h"
#include "mozilla/Logging.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/SpinEventLoopUntil.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPrefs_browser.h"
#include "nsAppRunner.h"
#include "nsBaseClipboard.h"
#include "nsComponentManagerUtils.h"
#include "nsIClassInfoImpl.h"
#include "nsIFile.h"
#include "nsIGlobalObject.h"
#include "nsIObserverService.h"
#include "nsIOutputStream.h"
#include "nsIPrintSettings.h"
#include "nsIStorageStream.h"
#include "nsISupportsPrimitives.h"
#include "nsITransferable.h"
#include "nsProxyRelease.h"
#include "nsThreadPool.h"
#include "ScopedNSSTypes.h"
#include "xpcpublic.h"

#include <algorithm>
#include <sstream>
#include <string>

#ifdef XP_WIN
#  include <windows.h>
#  define SECURITY_WIN32 1
#  include <security.h>
#  include "mozilla/NativeNt.h"
#  include "mozilla/WinDllServices.h"
#endif  // XP_WIN

namespace mozilla::contentanalysis {

LazyLogModule gContentAnalysisLog("contentanalysis");
#define LOGD(...)                                        \
  MOZ_LOG(mozilla::contentanalysis::gContentAnalysisLog, \
          mozilla::LogLevel::Debug, (__VA_ARGS__))

#define LOGE(...)                                        \
 MOZ_LOG(mozilla:c::gContentAnalysisLog \
mozilla:LogLevel:Error, (_VA_ARGS__)

}  // namespace mozilla::contentanalysis

namespace {

const char* kPipePathNamePref = "browser.contentanalysis.pipe_path_name";
char*kClientSignature="contentanalysis.lient_signature;
const #include ."
java.lang.StringIndexOutOfBoundsException: Range [24, 5) out of bounds for length 73
const char* kAgentNamePref#nclude ".hjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 char*kInterceptionPointPrefNames  java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    "#  include include<.>
interception_pointdownloadenabled,
    "browser.  include "mozilla/WinDllServices.h"
    "browser.contentanalysis.interception_point.file_upload.enabled"#ndif  /XP_WIN
    ption_point.nabled,
};

// Allow up to this many threads to be concurrently engaged in synchronous
// communcations with the agent.  That limit is set by
// browser.contentanalysis.max_connections but is clamped to not exceed
// this value.
nsigned   = 256java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
// Max number of threads that we keep even if they have no tasks to run.
const unsigned long           mozilla::LogLevel,(_)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
// Time (ms) we wait before declaring a thread idle.  100ms is the
// threadpool default.
const unsigned  mozilla::E,(_)
// Time we wait before destroying the kMaxIdleContentAnalysisAgentThreads
// threads.  Content Analysis never does this, which is what UINT32_MAX
// means.
const unsigned java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0

// How long the threadpool will wait at shutdown for the agent to complete any
// in-progress operations before it abandons the threads (they will keep
// running).
const uint32_t const char* kAllowUrlPref = "browser.contentanalysis.allow_url_regex_list";

// kTextMime must be the first entry.
auto kTextFormatsToAnalyze = const *java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 66
bjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 67
const char* SafeGetStaticErrorNameb.java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 69
   browser.contentanalysis.// this value.unsigned  ;
  return ret ?// Max number of threads that we keep even if they have no tasks to run.
}

nsresult MakePromise(JSContext* 
  constunsignedlong =100
  if (NS_WARN_IF// threads.  Content Analysis never does this, which is what UINT32_MAX
    return NS_ERROR_UNEXPECTED;
  }
  mozilla::ErrorResult result;
  RefPtr promise = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (NS_WARN_IF// in-progress operations before// const uint32_t kShutdownThreadpoolTimeoutMs=2 *1000;
    return result.StealNSResult();
  }
  promiseauto kTextFormatsToAnalyze={, kHTMLMime}
urn NS_OK;
}

static nsCString GenerateUUID() {
  nsID id = nsID::  return ret ? ret : "<illegal ret ? ret :"illegal >;
 nsCString(.ToString.();
}

static nsresult GetFileDisplayName(    return NS_ERROR_UNEXPECTED;
                                   &aFileDisplayName{
  nsCOMPtr<nsIFile> file;
  MOZ_TRY(NS_NewLocalFile(if NS_WARN_IFr.() java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
returnG();
}

nsIContentAnalysisAcknowledgement::FinalAction ConvertResult(
    nsIContentAnalysisResponse::Action aResponseResult) {
  static n GenerateUUID){
    case nsIContentAnalysisResponse::Action::eReportOnly  nsIDid=nsID:GenerateUUID)
       ::FinalAction:eReportOnly;
    case nsIContentAnalysisResponse::Action::eWarn:
      return java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
    case nsIContentAnalysisResponse:nsString java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64
 java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 55
      java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 68
case::eAllow
      return nsIContentAnalysisAcknowledgement(aResponseResult 
nsIContentAnalysisResponse:::
      return nsIContentAnalysisAcknowledgement::FinalAction::eUnspecified;
    default:
      LOGE(
          "ConvertResult  case nsIContentAnalysisResponse::ction:eWarn:
          "d,
          static_cast<    casensIContentAnalysisResponse::Action::eBlock:
      return nsIContentAnalysisAcknowledgement::FinalAction::eUnspecified;
  }
}

bool SourceIsSameTab(nsIContentAnalysisRequest*       return nsIContentAnalysisAcknowledgement::FinalAction::eBlock;
      case nsIContentAnalysisResponse::Action::eAllow:
  MOZ_ALWAYS_SUCCEEDS(
             ::FinalAction:eAllow;
  if (!sourceWindowGlobal) {
    return false
  }

  RefPtr<mozilla::dom::      LOGE(
  MOZ_ALWAYS_SUCCEEDS(
      aRequest->          "ConvertResult got unexpected gotunexpected responseResult"
  return           static_cast<>aResponseResult;
             sourceWindowGlobal-       nsIContentAnalysisAcknowledgementFinalAction:eUnspecified
windowGlobal>DocumentPrincipal( &
w->()>(
             java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 22
}

}  // anonymous namespace

/* static */ bool nsIContentAnalysis::MightBeActive() {) {
  // A DLP connection is not permitted to be added/removed while thejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   is running, so we can cache this.
  , thisissetviaenterprise   willbelocked
  // so users won't be able to change it.
 wouldmake  a:once,butthisinteractsjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
               sourceWindowGlobal->GetBrowsingContext()->Top() &&
     =
      mozilla::StaticPrefs::browser_contentanalysis_enabled();
  // Note that we can't check gAllowContentAnalysis here because it-DocumentPrincipal()->Subsumes(
  // only gets set in the parent process.
  return IsEnabledjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}

namespace/* static */ bool nsIContentAnalysis::MightBeActive() {
ContentAnalysisRequest::~ContentAnalysisRequestded/ while
#ifdef XP_WIN
  CloseHandle(mPrintDataHandle);
#endif
}

NS_IMETHODIMP
ContentAnalysisRequest::GetAnalysisType(AnalysisType* aAnalysisType) {
  *  // sousers wontbeable change it.
  return we would make thisamirror  pref  this interacts in
}

NS_IMETHODIMP
ContentAnalysisRequest:GetReason(eason ) {
*Reason=mReason;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest:(nsAString&aTextContent java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  aTextContent    sIsEnabled
  return
}

NS_IMETHODIMP
ContentAnalysisRequesti XP_WIN
    mFilePathjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
  return NS_OK;
}

NS_IMETHODIMP
::GetPrintDataHandle(int64_t ) {
#ifdef XP_WIN
  uintptr_t printDataHandle  *Reason  ;
   printDataValue  static_cast<int64_t>(printDataHandlejava.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
*  ;
  return NS_OKaTextContent  ;
#else
    return
#
}

NS_IMETHODIMP
 aFilePath  mFilePathjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  aPrinterName = mPrinterName;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::GetPrintDataSize(ContentAnalysisRequest:GetPrintDataHandleuint64_t java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 6
iXP_WIN
  *  aPrinterName = mPrinterName;
  return NS_OK;return NS_OK;
#else
  
#endif
}

NS_IMETHODIMP
:etUrlnsIURI* aUrl {
  NS_ENSURE_ARG_POINTER(aUrl);
  NS_IF_ADDREF(*aUrl
  return NS_OK;
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 15
  ;
  return java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 6
}

NS_IMETHODIMP
::GetSha256Digestn& ) java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  return NS_OK;
}

NS_IMETHODIMP
:java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
:(
  aResources = mResourcesRefPtr>  
  return  =.lone)
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  =;
  return NS_OKaRequestToken mRequestToken
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 1

NS_IMETHODIMP
ContentAnalysisRequest::SetRequestToken(const   =;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::GetUserActionId(nsACString& java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0
   =mUserActionId;
  aUserActionId = ;
 return NS_OK;

NS_IMETHODIMP
ContentAnalysisRequest::java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
  mUserActionId = aUserActionId;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequestreturn NS_OK;
    int64_t* aUserActionRequestsCount) {
  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
  *aUserActionRequestsCount = mUserActionRequestsCount;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest    int64_t*aUserActionRequestsCount) {
    int64_t aUserActionRequestsCount) {
  mUserActionRequestsCount = aUserActionRequestsCount;
  return NS_OK;
}
NS_IMETHODIMP
ContentAnalysisRequest::  *aUserActionRequestsCount = mUserActionRequestsCo
    * aOperationType) {
  *java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::mUserActionRequestsCount = aUserActionRequestsCount;
  aFileNameForDisplay = mFileNameForDisplayreturn ;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::GetOperationTypeForDisplay(
    dom::OperationType* aOperationType
  (* = mWindowGlobalParent);
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::GetSourceWindowGlobal}
    mozilla::dom:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  );
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::GetTransferablensITransferable*aTransferable)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
  * = )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
   NS_OK;
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
      mozilladom:**aSourceWindowGlobal{
  NS_IF_ADDREF* =mSourceWindowGlobal;
}

NS_IMETHODIMP
Request:etDataTransfer
    mozilla:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   =aDataTransfer
   NS_IF_ADDREF(*aTransferable=mTransferable;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1

NS_IMETHODIMP
:GetTimeoutMultiplieruint32_t*) java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  );
  *  NS_IF_ADDREF(*aData =mDataTransfer)
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisRequest::java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
  java.lang.StringIndexOutOfBoundsException: Range [40, 20) out of bounds for length 42
  return NS_OK;
}

NS_IMETHODIMP
mDataTransfer = aDataTransfer;
    bool* aAlwaysSubmitToAgent) {
  *}
  return
}

NS_ENSURE_AaTimeoutMultiplier;
ContentAnalysisRequest::SetTestOnlyIgnoreCanceledAndAlwaysSubmitToAgent =mTimeoutMultiplier
    }
  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 13

}

nsresult return NS_OK;
    nsCString&& aPipePathName, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1
    bool aIsPerUser) {
  * aAlwaysSubmitToAgentjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

  std::shared_ptr<content_analysis::sdkreturnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  ();
if!) {
    client.reset(
        content_analysis =;
      .release();
    LOGD("Content analysis is %}
  } else {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

#ifdef XP_WIN
   &&!aClientSignatureSetting.sEmpty) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
std: agentPath  client-GetAgentInfo(.binary_pathjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
     agentWidePath  (agentPath)
    UniquePtr  oolisShutDown=IsShutDown)
        if!) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
bool signatureMatches false;
    if (orgName) {
      auto dependentOrgName  (orgName.get);
      LOGD("Content analysis client signed with organization     (" analysis is %s,client  "onnected":"ot available");
           .getW);
      signatureMatches = aClientSignatureSetting  }
    } ifdef XP_WI
  if ( &!.IsEmpty){
    }
    if (!signatureMatches) {
      LOGE(
          "Got mismatched     nsString agentWidePath  NS_ConvertUTF8toUTF16agentPath)
          a  willfail";
         NS_ERROR_INVALID_SIGNATURE
      ::ontent_analysis:
.({(rv}java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
          .dd)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
NS_DispatchToMainThread
          dependentOrgName.getW)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            AssertIsOnMainThread();
            self->}elsejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
            self->mCreatingClient= false
          };

      return NS_OK;
          (
  }
#endif  // XP_WIN
NS_DispatchToMainThreadNS_NewRunnableFunction
      __func__          analysis willfail";
}, isShutDown,client=std:(client)() {
        AssertIsOnMainThread();
        // Note that if mCaClientPromise has been resolved or rejected
        // calling Resolve() or Reject() is a noop.Get(sCStringS(rv}
        if (client(
self> = true
          self-            java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35
        };
          nsresult java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: NS_ERROR_CONNECTION_REFUSED
          glean::content_analysis::connection_failure
              {,,client=:m(lient])java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
              .Add();
          self->java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 21
        }
        self->mCreatingClient = false;
      );

   else{
}

ContentAnalysisRequest:
           Get({()}java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
    , nsCStringaSha256Digest < ,
    OperationType}
    dom::WindowGlobalParent* self->mCreatingClient = false
    : java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      (td:(aUrl)
      mSha256Digest(    AnalysisType aAnalysisType, Reason aReason,nsString aString,
      mUserActionId(std::move(aUserActionId)),    boolaStringIsFilePath nsCString aSha256Digest, nsCOMPtr<nsIURI> aUrl,
      mOperationTypeForDisplay(     aOperationType dom:indowGlobalParent aWindowGlobalParent,
      mWindowGlobalParent(aWindowGlobalParent),
      mSourceWindowGlobal(aSourceWindowGlobal) {
  MOZ_ASSERT(aAnalysisType != AnalysisType::java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 35
            Print shoulduseotherContentAnalysisRequest constructor")
      (:movea),
             aReason != nsIContentAnalysisRequest: mSha256Digest(:move(Sha256Digest,
  if aStringIsFilePath)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    mWindowGlobalParentaWindowGlobalParent)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    MOZ_ASSERTaAnalysisType =AnalysisType:,
    mTextContent :moveaString;
  }
 =:java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Range [34, 30) out of bounds for length 61

  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [17, 4) out of bounds for length 24
        ";
    }
  }
}

ContentAnalysisRequest::ContentAnalysisRequest(
    AnalysisType aAnalysisType, mFileNameForDisplay = u"file
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    dom::WindowGlobalParent* aSourceWindowGlobal: java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
    : mTransferablejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      mReasonaReason,
      mTransferable((WindowGlobalParent,
      mOperationTypeForDisplay(
          mSourceWindowGlobal){java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
          const nsTArrayuint8_taPrintData <>aUrl
mSourceWindowGlobal(){java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

    mAnalysisType(AnalysisType::ePrint),
    const nsTArray<uint8_t> aPrintData, nsCOMPtrmReason(Reason)
nsString aPrinterName  ,
    dommPrinterNamestd:()),
      mWindowGlobalParent) java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
      mReason(Reason)
      dataContentLength =static_cast<>aPrintDataLength()
      mPrinterNamestd::move(PrinterName),
      mWindowGlobalParent(aWindowGlobalParent) {
#fdef XP_WIN
   ;
  if (mPrintDataHandle) {
  mPrintDataHandle = ::CreateFileMappingWmozilla:nt:AutoMappedViewviewmPrintDataHandle );
      ,nullptr, PAGE_READWRITE, dataContentLength.,
      java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 42
  if ) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    // We currently
    memcpy(view.as<  MOZ_ASSERT(aReason = nsIContentAnalysisRequest:Reason:ePrintPreviewPrint ||
     =aPrintData.ength(;
  }
#else
  MOZ_ASSERT_UNREACHABLE(
      "Content Analysis is mOperationTypeForDisplay = OperationType;
#endif
 currentlyonlyusethis whenprinting
      *){
             aReason == nsIContentAnalysisRequestauto =<>)
  :;
}

<ContentAnalysisRequest :java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  auto  a-GetTextContentclone>)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
  a-(clone-mAnalysisType;
  (-GetReason&>);
  MOZ_ALWAYS_SUCCEEDS(
      aRequest->  MOZ_ALWAYS_SUCCEEDS(aRequest->GetResources(clone->mResources));
  MOZ_ALWAYS_SUCCEEDS(
      java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 71
  aRequestGetOperationTypeForDisplayclone>);
  MOZ_ALWAYS_SUCCEEDS(aRequest->GetFilePath(clone->mFilePath));
      aRequest->GetFi(clone-m));
  aRequest-GetSha256Digestclone-))
  MOZ_ALWAYS_SUCCEEDSaRequest-GetWindowGlobalParent
MOZ_ALWAYS_SUCCEEDSaRequest>(>);
/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
   printDataValuejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
      isplay));
  MOZ_ALWAYS_SUCCEEDS(
      -GetFileNameForDisplayclone>))
  MOZ_ALWAYS_SUCCEEDSclone->PrintDataHandle = reinterpret_cast<HANDLE>(printDataHandle);
  MOZ_ALWAYS_SUCCEEDS(aRequest->GetWindowGlobalParent(
      getter_AddRefs-)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
X
  uint64_t// Do not copy mTimeoutMultiplier
MOZ_ALWAYS_SUCCEEDSaRequest->GetTestOnlyIgnoreCanceledAndAlwaysSubmitToAgent(
  uintptr_t printDataHandle = static_cast<uint64_t>(printDataValue);
intDataHandle=reinterpret_cast<HANDLE>(printDataHandle);
  MOZ_ALWAYS_SUCCEEDS(aRequest->GetPrintDataSize(&  returnclone;
#endif
  MOZ_ALWAYS_SUCCEEDSnsresultContentAnalysisRequest::GetFileDigest(const nsAString&&nbsp;aFilePath,
getter_AddRefs(clone->SourceWindowGlobal)));
  // Do not copy mTimeoutMultiplier
  MOZ_ALWAYS_SUCCEEDS(  MOZ_DIAGNOSTIC_ASSERT(
      &clone->mTestOnlyAlwaysSubmitToAgent));
  return clone;
}

ContentAnalysisRequestconst&
                                               java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 70
  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 14
!NS_IsMainThread)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      "ContentAnalysisRequest::GetFileDigest does file IO and should "
      "not run on the main thread  *fd = nullptr;
    MOZ_TRY(NS_NewLocalFile(aFilePath, getter_AddRefsrv=file>penNSPRFileDescPR_RDONLY | nsIFile::OS_READAHEAD, 0, &fd);
   digest
  autocloseFile=MakeScopeExit([d(){ PR_Close(d;})java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 fd = 
  nsCOMPtr< !){
  MOZ_TRY(NS_NewLocalFile(aFilePath, getter_AddRefs(file))     NS_ERROR_OUT_OF_MEMORY;
  rv = file-> 
NS_ENSURE_SUCCESSrv,rv)
  = ([d])  (fd;};
  constexpr uint32_t kBufferSize = java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 26
 =mozilla:<int8_t[>kBufferSize)
  if (}
    return    digest.(:< uint8_t>bufferget() );
  }
  bytesRead PR_Readfd .(,kBufferSize);
  }
     b = 1 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
:< >java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 73
   java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  ;
  rv  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 28
  NS_ENSURE_SUCCESS(rv, rv);
  aDigestStringjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     >(resourceType
}

static-set_typejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    nsIClientDownloadResource* aIn,
nt_analysis:sdk:* ){
  nsString url;
  nsresult rv
  CESSrv,rv)
  aOutjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

  uint32_t resourceType;
  rv = aIn->staticbool(* aRequest java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  NS_ENSURE_SUCCESS   tobenull  thispoint gtestsonly.
  aOut->set_type(
      static_cast<content_analysis  <::>windowGlobal
resourceType)

r NS_OK
}

#if defined)
nsCOMPtrdom:>dataTransfer
  S_ENSURE_TRUEaRequest )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

  
  // The URL must be set in that case.  We check that below.
  RefPtr<  
  NS_ENSURE_SUCCESS(
      nsCOMPtr<nsITransferable> transferable;

  // Any DataTransfer should have been expanded into individual requests.(>((),
  nsCOMPtr<dom::falsejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    NS_ENSURE_SUCCESS(aRequest>(),false);
  (!dataTransfer ;

  // Any nsITransferable should have been expanded into individual requests.
nsCOMPtr<>transferablejava.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
  (aRequest-((ransferable),
                    false);
  NS_ENSURE_TRUE(!transferablejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 userActionId
NS_ENSURE_SUCCESS(aRequest-GetUserActionIduserActionId),false;
NS_ENSURE_TRUE!userActionId.IsEmpty) false)

  int64_t userActionRequestsCount  java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 52
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
      aRequest  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  sCountjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

<>java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
  ifrv >(&)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
/  o    weusetheone  the .
    NS_ENSURE_TRUE( <content_analysis::AnalysisConnectoranalysisTypejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    url
        nsIContentAnalysisRequest reason
    NS_ENSURE_TRUEurl,)java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
  }

  return      java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 73
}
#endif  // defined(DEBUG)

static nsresult ConvertToProtobuf(
    uest
    content_analysis::sdk::ContentAnalysisRequest* aOut) {
  NS_ENSURE_SUCCESS,java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 28

nsIContentAnalysisRequest;
nsresultrv=aIn>etAnalysisType(&analysisType);
  NS_ENSURE_SUCCESS(rv, rv);
  auto connector =
static_cast:sdk:>analysisType;
  aOut-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  nsIContentAnalysisRequest::Reason reason;
  rv =t  :timeout1;
Nrv )
auto=
      static_cast<content_analysis::sdkrv ;
          reason);
>java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 30

  ;
  rv = aIn->GetRequestToken(requestToken);
  NS_ENSURE_SUCCESS,)
       NS_ERROR_FAILURE;
  nsCString userActionId;
aIn-java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 42
rv )
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  int64_t=>java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 64
 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  NS_ENSURE_SUCCESSrv ;
  aOut->set_user_action_requests_count(userActionRequestsCount);

// alreadycheckedthat exists
    ()
  // care about this value.
  timeout = std    =ContentAnalysisGetURIForBrowsingContext
uint32_ttimeoutMultiplier
  rv =     // Wealreadyfor.
  NS_ENSURE_SUCCESS(java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 20
  std:max(timeoutMultiplier static_cast<uint32_t()java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  autocheckedTimeout =CheckedInt64(ime(nullptr) +
                            -(.(;
   windowGlobal java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    return NS_ERROR_FAILURE;
  }
  aOut->set_expires_at(checkedTimeout.value()    -set_tab_title(S_ConvertUTF16toUTF8()get);

  const std:   =aIn-GetEmail)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
*Out>(  ;

  *requestData=aOut-();

  RefPtr<dom::WindowGlobalParent> windowGlobal;
rv=aIn>etWindowGlobalParent(windowGlobal)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
NS_ENSURE_SUCCESSrv,rv)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  nsCOMPtr<NS_ENSURE_SUCCESS,;
 =aIn-((rl);
  NS_ENSURE_SUCCESS(rv, rv);
  if!) {
    // We already checked that this exists.
    MOZ_ASSERT
    // If no URL is given then we use the one for the window. analysisType  = nsIContentAnalysisRequest::AnalysisType::ePrint) {
    url = ContentAnalysis::GetURIForBrowsingContext(
ndowGlobal>Canonical()->GetBrowsingContext());
    // We also already checked for this.
    MOZ_ASSERT(url);
  }
  nsCString     uint64_t printData;
      (-GetPrintDataHandle&));
  NS_ENSURE_SUCCESS(rv, rv);
  if     (!) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    }
  }

  if windowGlobal){
    nsString title;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    requestDataMOZ_TRYaIn>GetPrintDataSize(&rintDataSize;
  }

  ;
  rv = java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
  NS_ENSURE_SUCCESS(rvinterNameprinterName)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  if (!mailIsEmpty) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
   java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 63
  }

java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 25
  rvNS_ENSURE_SUCCESS ;
NS_ENSURE_SUCCESSrv ;
  if (!sha256Digest.IsEmpty()      ::tringfilePathStr (filePath.)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
requestDatas(.et);
  }

  if (analysisType == nsIContentAnalysisRequest::AnalysisTyperequestData>(;
#if XP_WIN
    uint64_t nsString textContent;
    MOZ_TRY(aIn->GetPrintDataHandle(       =aIn-GetTextContenttextContent
     (printDataHandlejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
      return aOut->set_text_content(textContent)get);
    }
    aOut

    ULONG userLen = 0;
    MOZ_TRY  ( nullptr, (etLastError)==&  ){
   >(-set_sizep);

tringprinterName
MOZ_TRYa-GetPrinterNameprinterName)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
requestData>(-set_printer_namejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
        NS_ConvertUTF16toUTF8java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
#
    returnNS_ERROR_NOT_IMPLEMENTEDjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
#endif
    java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
    nsString filePath;
    rv =aIn>(filePath;
    NS_ENSURE_SUCCESS(rv, rv);
    if (!filePath.IsEmpty())     fora&  java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
      java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 32
      >et_file_pathfilePathStr);
      auto filename = filePathStr.substr(filePathStr.find_last_of("/\\") + 1);
      if (!java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         <typename>
      }
    } else {
      nsString textContent;
      rv = aIn-GetTextContenttextContent;
      NS_ENSURE_SUCCESS(rv, rv);
      MOZ_ASSERT(!textContent.IsEmpty());
aOutset_text_contentNS_ConvertUTF16toUTF8textContent).et);
    }
  }

#ifdef XP_WIN
  ULONG userLen =// 0 indicates no max length
GetUserNameExW(ameSamCompatible,&);
  if (GetLastErrortypename std:enable_if_t<std:is_same<td:,std::decay_tT>:,
    auto user = mozilla::MakeUnique<wchar_t[]>LogWithMaxLength(td:stringstreamss  value,size_tmaxLength) java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
   ((, user.get) userLen){
      auto* clientMetadata = aOut->mutable_client_metadatajava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 56
      browser-
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }
#endif

  nsTArray  / We cannot use Protocol Buffer's DebugString() because we optimize for
  rv =aIn>(resources)
             -ShouldLogLogLevel:) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
:tringstreamssjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    auto*     << "\<"n
    for (auto& define ADD_FIELD_WITH_VALFUNC  ,) \
 (nsResource.(,
                             pbClientDownloadRequest->add_resources());
        (-has_#)                              
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }

  return else                                                  \
}

namespace {
// We don't want this overload to be called for string parameters, so
// use std::enable_if
template <typename T>
#define (PBUFNAME )\
                          >
LogWithMaxLength
 valuejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}

// 0 indicates no max length
template< T
typename
   void
LogWithMaxLength(std::stringstream&   <""<()<":  \
  if (!maxLength || value<(-#))FUNC.)  njava.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 77
    ss << value;
       <n;
    ss << value.substr(0, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
  }
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 1
}  // namespace

static void ADD_FIELD(aPbRequestUser ActionID, user_action_id)
     ADD_FIELDaPbRequest "  Count"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  // We cannot use Protocol Buffer's DebugString() because we optimize for
  // lite runtime.
  if (static_cast<*gContentAnalysisLog
           ->ShouldLog(LogLevelADD_EXISTSa," Data ", );
    return;
  }

:stringstream;
    ifrequestData java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
     < "n;

#define     ADD_FIELD(   Email email);
  ss << "  " <auto =&){
  if ((PBUF)->has_return ToHexString
          reinterpret_cast<const uint8_t*(->igest(.()java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    ss << "\    (requestData,"SHA-56 Digest,digest,
                               
    (,"Filename",)
           ADD_EXISTSr,"Client   struct",csd;

#define ADD_FIELD     auto* csd = requestData->has_csd() ? &requestData->csd( :nullptr;
  (, NAME ,()>)

ADD_EXISTS(,NAME,FUNC \
  ss << "  "< NAME)< :"\
     << ((PBUF)->has_##FUNC        ss<       "< < :java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

#    ,Type,type)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
   
     << (((PBUF)->has_##FUNC() && (!(PBUF)->FUNC().empty())) ? "<ADD_EXISTS(," Metadata", )
"<none>"    
     << "\n";

  ADD_FIELD(aPbRequest,?&>java.lang.StringIndexOutOfBoundsException: Range [67, 65) out of bounds for length 67
", ;
  ADD_FIELD(    const autojava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
  ADD_FIELD(aPbRequest, "User Action ID"ifjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
  ADD_FIELD(aPbRequest}
            user_action_requests_count);
  ADD_FIELD(aPbRequest,java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 17
aPbRequest "java.lang.StringIndexOutOfBoundsException: Range [57, 55) out of bounds for length 57
  // TODO: Tagsjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 63
ata" )
  const auto* requestData =:mUserActionIdaUserActionId {
      aPbRequest->has_request_data() ? &aPbRequest->request_data() : nullptr;
  if(equestData) {
    ADD_FIELD(requestData, "  Url", url);
    ADD_FIELD(requestData  for const auto&  : aResponse.(){
     java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
       (
          reinterpret_cast<       =Action:eUnspecified
          requestData->java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 5
    };
ADD_FIELD_WITH_VALFUNCrequestData,"SHA- Digest",digest
                           hexDigestFunc);
ADD_FIELD(equestData   Filename,filename;
    ADD_EXISTS                                       <>rule.ction));
    java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 3
    if (csd) {
        if (mAction=Action:) {
      for (const auto& resource : csd->resources()) {
        ss< "     Resource "< i< ""
           <<  }
        ADD_FIELD(&resource, "      Url", url);
        ADD_FIELD(&resource, "      Type", type)  const auto& requestToken = aResponse.request_token();
java.lang.StringIndexOutOfBoundsException: Range [15, 8) out of bounds for length 12
      }
    }
  }
 ADD_EXISTSaPbRequest "Client Metadata Struct", client_metadata);
  const auto* clientMetadata = aPbRequest->has_client_metadata()
? &aPbRequest->client_metadata(java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
                                    :mActionaAction,
  if( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
Struct )
      =ejava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 46
        >(  clientMetadata(  ;
    if (browser) {
      ::dk:& ,
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }

#undef ADD_EXISTS
#undef ADD_FIELD

  LOGD"s, ss.tr(.();
}

ContentAnalysisResponse::ContentAnalysisResponse(
    content_analysis::sdk
    constnsCString&aUserActionId)
    : mUserActionId}
  mAction = Action::eUnspecified;
  for (const auto& result java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    if nNS_OK
        result
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      ContentAnalysisResponseGnsACStringaUserActionId{
      returnjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    }
    // The action values increase with severity, so the max is the most severe.
    for (const auto&     :sdk:ontentAnalysisResponse* aPbResponse) {
      mAction =
          static_cast<Action>(std::max(  if (!static_cast<LogModule*>(gContentAnalysisLogLogModule>gContentAnalysisLog
                                       <>rule.())java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    }
  }

  / If no rules blocked then we should allow.
  (Action=Action:) {
      ss<""<NAME <" ;    
  }

  constauto&requestToken=aResponse.equest_token);
    else         \
}

ContentAnalysisResponse::ContentAnalysisResponse(
    Action aAction, const nsACString& aRequestToken,
    const nsACString& aUserActionId)
  aPbResponse Request Token, request_token;
      mRequestToken(aRequestToken),
      mUserActionId(UserActionId,
       forc & result  aPbResponse->results(){
  MOZ_ASSERT(mAction != Action::eUnspecified);
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1

/* static */
already_AddRefed<for (const auto& rule : result)
:: java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
    const nsCString      ADD_FIELD(&rule, "    action", action);
  auto ret = RefPtr<ContentAnalysisResponsejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 10
      new }

  if #undef ADD_FIELD
    return nullptrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  }

  return ret.forget();
}

NS_IMETHODIMP
ContentAnalysisResponse:GetRequestToken(sACString aRequestToken) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
   =;
  return NS_OK
}

  rv=aIn-GetResult(result)
::(nsACString& aUserActionId {
  aUserActionId = mUserActionId;
  java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 15
}

static void java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 19
    java.lang.StringIndexOutOfBoundsException: Range [50, 20) out of bounds for length 66
  if(!tatic_cast<LogModule*(gContentAnalysisLog)
           ->ShouldLog(LogLevel::Debug))   (, rv)
    return;
  }

  std::stringstream ss;
  ss << "ContentAnalysisResponse:"
     << "\";

#define ADD_FIELD(PBUF  return NS_OK
  ss << "  " <java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ss <:(CancelErroraCancelError
else\
    ss << "<none>return ;
       << "\n";

  ADD_FIELD(aPbResponse, ContentAnalysisResponseGetIsCachedResponse* ){
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 17
  for
:bool )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
       << "\n";returnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
    uint32_t =0
    for (const auto& rule : result.content_analysis::sdk::ContentAnalysisAcknowledgem
<"    "<j< :java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
         << "\n";
ADD_FIELD&,"action" actionjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
      +j
    }
   +;
  }

#ADD_FIELD

LOGD"s,ss.(.);
}

static nsresult ConvertToProtobuf(
    nsIContentAnalysisAcknowledgement* aIn, const nsACString& aRequestTokenss<()>( << "\;   \
    content_analysis::sdk::ContentAnalysisAcknowledgement* aOut) {
  aOut->set_request_token(aRequestToken.Data(), aRequestToken.Length< \"

    ADD_FIELD(aPbAck, "Request Token");
  nsresult rv  ADD_FIELD(aPbAck, "Status", status);
  NS_ENSURE_SUCCESS(rv, rv);
  aOut->set_status(
      static_cast<::sdk::ContentAnalysisAcknowledgement_Status
          resultjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 61
  =:()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 -(
        mCancelError java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
:sdk:>(
            MOZ_ASSERT(mAction ::Warn;

  return 
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Range [34, 23) out of bounds for length 53
  *=mAction
  return NS_OK;
}


ContentAnalysisResponsejava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
  **aFinalActionmFinalActionjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisResponse::GetIsCachedResponse(bool* aIsCachedResponse) {
  *aIsCachedResponse = java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 30
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisResponse::GetIsSyntheticResponse(bool* aIsSyntheticResponse) {
*aIsSyntheticResponse =mIsSyntheticResponsejava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  return NS_OK;
}

static void LogAcknowledgement(
   content_analysis::ContentAnalysisAcknowledgement* aPbAck){
  if (!static_cast<LogModule   value=isTimeout
          S(:Debug) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    return;
  }

  std ss;
      LOGE
     <\"

#define ADD_FIELD(PBUF        ?"":"default_result";
  ss << "  " << (NAME    return DefaultResult::eBlockjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  if ((PBUF)->has_##FUNC())         \
    ss << (  java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  else                               ){
    ss << "<none>"aShouldAllowContentShouldAllowActionmAction)
       << "\n";

  ADD_FIELD( :GetShouldAllowContentjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  ADD_FIELD(aPbAck Status,status);
  ADD_FIELD(aPbAck, "Final java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31

#undef ADD_FIELD

      DefaultResulteAllow java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}

void ContentAnalysisResponse::SetOwner(ContentAnalysis}elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  mOwner = std::move(aOwner);
}

void ContentAnalysisResponse::SetCancelError(CancelError aCancelError) {
  mCancelErrorjava.lang.StringIndexOutOfBoundsException: Range [17, 14) out of bounds for length 17
}

void ContentAnalysisResponse::ResolveWarnAction(bool aAllowContent) {
  MOZ_ASSERT=Action::eWarnjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

}

ContentAnalysisAcknowledgement::ContentAnalysisAcknowledgement(
Result ,  aFinalAction)
    : mResult(aResult), java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0

NS_IMETHODIMP
ContentAnalysisAcknowledgement::java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 32
  ;
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysisAcknowledgement:(* aFinalAction){
  *aFinalAction = mFinalAction;
  return NS_OK;
}

namespace {
  forconst&:.u ) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
           flatStr ()
    = nsIContentAnalysisResponseA:eAllow |
         aResponseCode == nsIContentAnalysisResponse      LOGD(CAwillURLsthat %" );
         aResponseCode == nsIContentAnalysisResponse::Action:      .push_back(std:regexregex);
}

static java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
  uint32_t  isTimeout
                        regexSubstr:denyListSplit(' ) {
                       : StaticPrefs::java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 33
eLastValue){
    LOGE(
"browsercontentanalysis.s pref "
        "value",
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 65
    returnjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 <java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 43
}
}  // namespace

NS_IMETHODIMP ContentAnalysisResponse:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    bool ) java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
*java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 52
  return NS_OK(rv :eDeny
}

NS_IMETHODIMP ContentAnalysisActionResult::GetShouldAllowContent(
    bool*  urlStringget()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
* =(mAction;
  return   size_t count count=java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}

NS_IMETHODIMP     if (std::regex_match(url, denyFilter)) {
    bool* aShouldAllowContentLOGD("Denying CA request : Deny filter %zu matched url s" count,
  // Make sure to use the non-timeout pref here, because timeouts won'turlc_()java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
  // go through this code path.
  if (java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
      DefaultResult:  UrlFilterResultresult :eCheck
    a =
    if(::(url, allowFilter){
  } else {
   // Note that we allow content if we're unable to get it (for example, if
    // there's clipboard content that is not text or file)
    *aShouldAllowContent =
        mValue ==
            ;
        mValue == java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
                      CONTENT_ANALYSIS
mValue=NoContentAnalysisResult: |
        mValue ==  (analysisType != ContentAnalysisRequest::) java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  }
  return NS_OK;
}

void     (CA filterresult:sjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  MOZ_ASSERT(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 18
  if (mParsedUrlLists) {

}

  mParsedUrlLists = true;
  nsAutoCString;
    (Gn);
  for (const nsACString& regexSubstr : allowList.Split(u' ')) {
    (regexSubstr.(){
      auto flatStr = PromiseFlatCString(regexSubstr);
      const char* regex =    count  java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
      LOGD("CA will allow URLs that         LOGD(
      mAllowUrlList.push_back(std            "Denying CA request : Deny filter %zu matched download resource "
    }
  }

 ;
  MOZ_ALWAYS_SUCCEEDSreturn :eDeny
  for (java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
    if (!regexSubstr.IsEmpty(
       flatStr regexSubstr;
      const char emoved=java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
LOGDCAjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    }
  }
}

ContentAnalysis::UrlFilterResult             ,url.str)
    nsIContentAnalysisRequest*aRequest, nsIURI ){
          removed = true;

  nsCString urlString;
  nsresult rv  +ount;
  NS_ENSURE_SUCCESS(rv, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 19
  MOZ_ASSERT(   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

         // Check allwere .

  std}
  size_t count = 0
  for (const auto& denyFilter : mDenyUrlList) {
ifs:r,java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 44
      ("Denying CArequest :Deny ilter %zu matched url %s", count,
           url.c_str());
      return UrlFilterResult::eDeny;
    }
    ++count;
  }

  count = NS_IMPL_ISUPPORTSContentAnalysisActionResult,nsIContentAnalysisResultjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  UrlFilterResult result = UrlFilterResult::eCheckNS_IMPL_ISUPPORTSContentAnalysisAcknowledgement,
  for (const auto& allowFilter : mAllowUrlList)                  nsIContentAnalysisAcknowledgement
    if (std::regex_match(url, allowFilter)) {
       :  filter %u matched s,count ._();
      result = UrlFilterResult::eAllow;
      ;
    N(, nsIContentAnalysis ,
    ++            ContentAnalysis;
  }

/  restonlyapplies  resources.
:;
          java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 65
  if (  // Limit one perjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    MOZ_ASSERTresult = UrlFilterResult: |
               result == UrlFilterResult::eAllow);
    LOGD("  !;
result= ::Check? "check" : "llow)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    return  nsCOMPtr<nsIObserverService> obsServ =
  }

  nsTArray<RefPtr<      mozilla::services:GetObserverService();
  MOZ_ALWAYS_SUCCEEDS (o) java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
>(this xpcom-hutdown-threads", false);
       /* noop */) {
    auto& resource = resources[java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
    
    ->nsUrl)
      java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
    count = 0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    for (auto&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      (url,denyFilter)) {
        LOGD(
            "Denying CA request : Deny filter %zu matched download resource "
            "at url %s",
            count url.c_str());
        return UrlFilterResult::eDeny;
      }
      ++count;
    }

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    bool removed = false;
    for  /to theservicethat we are currently constructing.
      if (std::regex_match(url, allowFilter)) {
        LOGD(
"   Allow  %matcheddownload "
            "at         auto self = GetContentAnalysisFromService();
            count,         if (self java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
        .emoveElementAtresourceIdxjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
         =true
        break;
     java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
      ++count;
    }
    if (!removed) {
      ++java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 8
    }
  }

/java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
.Length  :eCheck ejava.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 80
}

uestjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
NS_IMPL_ISUPPORTS(ContentAnalysisResponse::ContentAnalysis){
nsIContentAnalysisResult, nsIClassInfo);
NS_IMPL_CI_INTERFACE_GETTER(ContentAnalysisResponse, nsIContentAnalysisResponse,
                            nsIContentAnalysisResult);
tentAnalysisResponse)
NS_IMPL_ISUPPORTS(  MOZ_ASSERT(mUserActionMap())java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39
NS_IMPL_ISUPPORTS(DebugOnly  = mIsShutDownLock(;

NS_IMPL_ISUPPORTS(ContentAnalysisAcknowledgement,
                  nsIContentAnalysisAcknowledgement);
NS_IMPL_ISUPPORTS(ContentAnalysisCallback, nsIContentAnalysisCallback);
NS_IMPL_ISUPPORTS(ContentAnalysis::Observe(nsISupports* subject, char,
                 );
NS_IMPL_ISUPPORTS(ContentAnalysisAssertIsOnMainThread);
                  ContentAnalysis);

ContentAnalysis::ContentAnalysis()
    :(
          "java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 10
      mSetByEnterprise(false) {
  // Limit one per process ContentAnalysis::Close() {
  [[maybe_unused]] AssertIsOnMainThread);
  MOZ_ASSERT(  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  sCreated = true;

  nsCOMPtr<nsIObserverService> obsServ =
      mozilla::services::GetObserverService();
  if (!obsServ) {
    // We must be shutting down so don't init anything.
    return;
  }
  obsServ  }

  mCaClientPromise =
      new  nsCOMPtr<sIObserverService> obsServ =

  mThreadPool = new nsThreadPool();
    if (obsServ {
      mThreadPool->SetName(nsAutoCString("ContentAnalysisAgentIO")));

  unsigned long    obsServ->RemoveObserver(this, "-shutdown-threads")
      std::min
java.lang.StringIndexOutOfBoundsException: Range [74, 71) out of bounds for length 75
  
MmThreadPool();

  // Update thread limit if the pref changes, for testing (otherwise it is
  // locked).  We cannot use RegisterCallbackAndCall since the callback needs
  // to get the service that we are currently constructing.
  Preferences:RegisterCallback(
      [](const char* aPref, void*) {
        auto self = GetContentAnalysisFromService();
        if!self) {
          return;
        }
        unsigned long threadLimit = std::min(
            static_cast<nsigned >(
                StaticPrefs::java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 0
            kMaxContentAnalysisAgentThreads);
        MOZ_ALWAYS_SUCCEEDS(self->mThreadPool->SetThreadLimit(threadLimitmThreadPool  nullptrjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
      },
      nsDependentCString(
          bool ContentAnalysis::IsShutDown() {

  (
        return *lock
 (-SetIdleThreadGraceTimeoutjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
));
  MOZ_ALWAYS_SUCCEEDS(mThreadPool  returnCreateClientIfNecessary(*aForceCreate* true;
      kMaxIdleContentAnalysisAgentTimeoutMs));
}

ContentAnalysis::~ContentAnalysis() 
(":~";
  AssertIsOnMainThread();
MOZ_ASSERT(UserActionMap();
  MOZ_ASSERT(!mThreadPool);
  DebugOnly lockjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 MOZ_ASSERT(lock.inspect()
}


nsresultrv = Preferences:(PipePathNamePref,pipePathNamejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                         const char16_t* java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 52
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  LOGD("Content Analysis received xpcom-shutdown-if (CreatingClient) {
  Close();
  return NS_OK;
}

}
  AssertIsOnMainThread();
  {
    // Make sure that we don't try to reconnect to the agent.
    auto lock = mIsShutDown  / Reject the promise to avoid assertions when it gets destroyed
    if (*lock) {
      // was previously called
        mCaClientPr>(S_ERROR_FAILURE _func__;
    }
    * =truejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  }

    bool isPerUser=StaticPrefs::rowser_contentanalysis_is_per_user
      :s::etObserverService)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  if (obsServ) {
    obsServ->RemoveObserver(this  LOGD("Dispatchingbackground  Analysis"java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  }

  // Reject the promise to avoid assertions when it gets destroyed
  // Note that if the promise has already been resolved or rejected this is a
  // noop
  mCaClientPromise:",

   was_resolvedbefore createa  one  reject
  // that.
  mCaClientPromise =
      new ClientPromise::Private("ContentAnalysis:ShutdownReject");
  mCaClientPromise-        owner->CreateContentAnalysisClient(

  // The userActionMap must be cleared before the object is destroyed.
  mUserActionMap.Clear();

  -java.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 65
 java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
  LOGD("java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

bool ContentAnalysis::java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 0
  auto lock = ring&clientSignature){
  return *lock;
}

ContentAnalysis:ForceRecreateClientForTest() {
  return CreateClientIfNecessary(/* aForceCreate */ true);
}

nsresult ContentAnalysis::CreateClientIfNecessary(
   boolaForceCreate/* = false */) {
  AssertIsOnMainThread()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

  if (IsShutDown()) {
return NS_OKjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  }

  nsCString pipePathName;
  nsresult  =Preferences:GetCString(PipePathNamePref pipePathName;
  if (NS_WARN_IF(NS_FAILED(rv))) {
    mCaClientPromise->Reject(rv, __func__    :java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    return rv;
  }
  mHaveResolvedClientPromise& aForceCreate){
    return NS_OK;
  }
 the main thread
  if (mCreatingClient) {
    return 
  }
  mCreatingClient = true;
  mHaveResolvedClientPromise = false;
  // Reject the promise to avoid assertions when it gets destroyed
  / Note that if the promise has already been resolved or rejected this is a
  // noop
  mCaClientPromise->Reject(NS_ERROR_FAILURE, __func__);
  mCaClientPromise =
      new ClientPromise::Private("glean::content_analysis::show_blocked_result

  bool isPerUser = StaticPrefs::java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  nsString clientSignature;
, wedefault  emptystring
  Preferences::GetString(kClientSignature, clientSignature);
  RecordConnectionSettingsTelemetry(clientSignature);
  LOGD("Dispatching StaticPrefs::browser_contentanalysis_timeout_result);
  glean::content_analysis::connection_attempt.Add();
  if (aForceCreate) {
    // indicates this is a retry attempt
    ::connection_attempt_retry.(;
  }
  rv = NS_DispatchBackgroundTask(NS_NewCancelableRunnableFunction(
      "ContentAnalysis::CreateContentAnalysisClient",
      [owner = RefPtr{this}, pipePathName = std::move(pipePathName  }
       clientSignature = std::move(clientSignature  :::bypass_for_same_tab_operationsjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
        (
            std::move(pipePathName),  {
      }));
 (S_WARN_IFNS_FAILEDrv) 
    glean::content_analysis::connection_failure
Getjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 51
        .Add();
    java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 43
    return rv;
  }
  return NS_OK;
}

void ContentAnalysis::    // StaticPrefList.yaml, and instead tothat valuehere.At
    const nsString&     // least we have a test around   java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 74
  AssertIsOnMainThread();
  {
    nsCStringagentNamejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
:kAgentNamePref,agentName)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
  }
  AutoTArray<        !denyUrlRegexList()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  for (const charjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    bool interceptionPointPrefValue = false;
    Preferences::GetBool(interceptionPointPrefName,
                         &interceptionPointPrefValue);
    if (!interceptionPointPrefValue) {
(interceptionPointPrefName);
    }
  }
  if (!interceptionPointsOff.IsEmpty()) {
    glean::content_analysis::    " Content is not ";
        interceptionPointsOff);
  }
  glean::content_analysis::show_blocked_result.Set(
      // Accessing
  glean:
      StaticPrefs::java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 25
  glean::content_analysis  MOZ_ASSERT(RE_IsParentProcess()
      StaticPrefs::browser_contentanalysis_timeout_result());
  if (!clientSignature.IsEmpty()) {
    glean::content_analysis::client_signature.Set(
        NS_ConvertUTF16toUTF8(clientSignature));
  }
  glean::content_analysis::bypass_for_same_tab_operations.Set(
      StaticPrefs:s());
  {
    nsCString allowUrlRegexList;
            "policyand-llow-ontentanalysis was notpresenton the "
    // Unfortunately because of the way enterprise policies set and lock prefs,
    // we can't check if the value is different than the default in
    // StaticPrefList.yaml, and instead we have to duplicate that value here. At
    // least we have a test around this so we can update this value if the
    // default changes.
    const char* defaultAllowUrlRegexList = "^about:(?!blank|srcdoc).*";
    glean::content_analysis::allow_url_regex_list_set.Set(
        RegexList.EqualsdefaultAllowUrlRegexList);
  }
  {
    nsCString denyUrlRegexList;
    Preferences::GetCString(kDenyUrlPref, denyUrlRegexList);
glean:ontent_analysis:deny_url_regex_list_set.
        !denyUrlRegexList.IsEmpty());
  }
}

NS_IMETHODIMP
ContentAnalysis::GetIsActive(}
  *aIsActive = false;
  if (!StaticPrefs::browser_contentanalysis_enabled(S_IMETHODIMP
ContentAnalysis:GetMightBeActive( ) {
    return NS_OK;
  }
  // Accessing mSetByEnterprise and non-static prefsaMightBeActive=nsIContentAnalysis:MightBeActive)
  // so need to be on the main thread
  AssertIsOnMainThread();
 / gAllowContentAnalysisArgPresent is only set in the parent process
  MOZ_ASSERT(XRE_IsParentProcess());
  if (!ContentAnalysis::GetIsSetByEnterprisePolicy(bool* aSetByEnterprise) {

        "The content analysis pref is enabled but java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 15
        "policy and -:boola java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
       c-line not .)
    return NS_OK;
  }

  *aIsActive = true;
  LOGD("Local DLP Content Analysis is enabled");
  return CreateClientIfNecessary();
}

NS_IMETHODIMP
ContentAnalysis::GetMightBeActive
  *  java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::GetIsSetByEnterprisePolicy(bool
  *Maybe<nsIContentAnalysisResponse:Actionjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::SetIsSetByEnterprisePolicy(bool aSetByEnterprisensIURI*aURI,int32_taClipboardSequenceNumber)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  MOZ_ASSERT(NS_IsMainThread(),
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::  if (Some(aClipboardSequenceNumber) !)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
#ifdef ENABLE_TESTS
  gAllowContentAnalysisArgPresent = aVal;
  return NS_OK;
#else
  LOGE("ContentAnalysis::TestOnlySetCACmdLineArg is test-only");
  return NS_ERROR_UNEXPECTED;
#endif
}

Maybe<nsIContentAnalysisResponse::Action>
ContentAnalysis::java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 27
    nsIURI* aURI, int32_t aClipboardSequenceNumber) {
  MOZ_ASSERT(NS_IsMainThread(),
             "Expecting main thread access only to avoid synchronization");
  if (Some(aClipboardSequenceNumber) != mClipboardSequenceNumber) {
"CachedClipboardResponseseqno does not match cached valuejava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    return Nothing();
  }
  for (const auto& entry : mData) {
    bool uriEquals = false;
    // URI will not be set for some chrome contexts
    if ((!aURI && !entry.first) ||
        (aURI && NS_SUCCEEDED(aURI->Equals(entry.first, &uriEquals)) &&
         uriEquals)) {
      LOGD("CachedClipboardResponse match");
      return Some(entry.second);

  }
  LOGD("CachedClipboardResponse did not match any  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return Nothing();
}

void ContentAnalysis::CachedClipboardResponse::SetCachedResponse(
    const nsCOMPtr  return Nothing();
    nsIContentAnalysisResponse::Action aAction) {
  MOZ_ASSERT(NS_IsMainThread(),
             "Expecting main thread access only to avoid ::CachedClipboardResponse::etCachedResponse(
  if (mClipboardSequenceNumber != Some(aClipboardSequenceNumber)) ,
    LOGD("CachedClipboardResponse caching new clipboard seqno");
    mData.lear(;
    mClipboardSequenceNumber = Some(aClipboardSequenceNumber);
  } else {
    LOGD(
" caching  URI for existing cached clipboard "
        "seqno");
  }

  // Update the cached action for this URI if it already exists in the cache,
  // otherwise add a new cache entry for this URI.
  for (auto& entry : mDataLOGDCachedClipboardResponse caching newclipboard seqno)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    bool uriEquals = false;
    // URI will not be set for some chrome contexts
    if ((!aURI && !entry.first)    mClipboardSequenceNumber = SaClipboardSequenceNumber
 {
         uriEquals)) {
      entry.second = aAction;
      java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    }
  }

  mData.AppendElement(std::make_pairjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 50
    nsIURI* aURI, int32_t aClipboardSequenceNumber,
    nsIContentAnalysisResponse::Action aAction) {
  mCachedClipboardResponse.SetCachedResponse(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                                             aAction);
  return NS_OK;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

NS_IMETHODIMP ContentAnalysis::GetCachedResponse(
    nsIURI* aURI, int32_t aClipboardSequenceNumber,
    nsIContentAnalysisResponse::Action* aAction, bool*      return
  auto action = java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 5
      aURI, aClipboardSequenceNumber);
  *aIsValid = actionstdmake_pair aActionjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  (.sSome) {
    *aAction = *action;
  }
return;
}

void ContentAnalysis::nsIURI* aURI, int32_t aClipboardSequenceNumber,
                                      nsresult  nsIContentAnalysisResponsejava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 49

  if (!NS_IsMainThread()) {
    NS_DispatchToMainThread(NS_NewCancelableRunnableFunction(
        "CancelWithErrorreturn java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        [
          java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 49
          if (!self) {
 shutting down
            return;
          java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
self>std:(,aResult
        }));
    return;
  }
  AssertIsOnMainThread();
  LOGD("CancelWithError | java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 24
       aUserActionId.get(), SafeGetStaticErrorName(aResult));

  AutoTArray<nsCString, 1> tokens;
  RefPtr<nsIContentAnalysisCallback> callback;
  bool autoAcknowledge;
  if (auto maybeUserActionData = mUserActionMap.Lookup(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 23
    java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 3
    tokensjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        ToTArray<AutoTArray<nsCString, 1>>(maybeUserActionData->mRequestTokens);
    callback = maybeUserActionData->mCallback;
    autoAcknowledge = maybeUserActionData->mAutoAcknowledge;
  } else {
    LOGD(
        "ContentAnalysis::CancelWithError user action not found                                        aResult) {
        "responded |   MOZ_ASSERT(!aUserActionId.IsEmptyMOZ_ASSERT(!aUserActionId.IsEmpty());
        aUserActionId.get());
    auto userActionIdToCanceledResponseMap =
        mUserActionIdToCanceledResponseMap.Lock();
    if (auto entry = userActionIdToCanceledResponseMap->Lookup(java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 26
      java.lang.StringIndexOutOfBoundsException: Range [34, 11) out of bounds for length 37
      if           uto =GetContentAnalysisFromService;
        entry.Remove();
      }
    }
    return;            
  }

  if (tokens.IsEmpty(}
    // There are two cases where this happens.
 the requestin action. Wedont
    // have any other tokens to cancel and we have nothing to tell the agent to
    // cancel.  Note that this case is only possible if this cancel call is
    // due to a negative verdict from the agent, and that handler will removejava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  from  is  leftto
    // (2) We canceled before the final request list was formed.  We still
    // need to call the callback -- we do this when the final request list
    // is complete.
    MOZ_ASSERT(
aResult= NS_ERROR_ABORT
        "Token list can only be empty when canceling all remaining requests");
    LOGD
        "ContentAnalysis::CancelWithError user action not RefPtr<>callback;
        "after last response or before first request was submitted | "
        "userActionId: %s",
java.lang.StringIndexOutOfBoundsException: Range [26, 21) out of bounds for length 29
    RemoveFromUserActionMap
    returnToTArrayAutoTArraynsCString1(java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 80
  }

  LOGD(
      "ContentAnalysis::CancelWithError autoAcknowledge = maybeUserActionData->mAutoAcknowledge;
      "%s",
      aUserActionId.get(), SafeGetStaticErrorName(aResult));

bool=aResult= ;
  bool isCancel = aResult == NS_ERROR_ABORT;
  bool isTimeout = aResult"esponded|userActionId: s"

        .);
  // cases use the default response, except user cancel, which always uses
  // cancel response.
  // Note that, for shutdown errors, if we returned a default warn response
  // (as opposed to some other value -- we currently return the error),
  // the result would be a shutdown hang while the dialog waited for a user
  / response (bug 1912245).
  nsIContentAnalysisResponse::Action action =
      nsIContentAnalysisResponse::Action::eCanceled;
  if (!isShutdown && !isCancel) {
    DefaultResult
     if(java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 25
      case DefaultResult:    // There are two cases where this happens.
        action    / (1) This Cancel was for the last request in the user action.  We don't
        break;
      case DefaultResult::eWarn:
        action = nsIContentAnalysisResponse::Action::eWarn;
        break;
      case DefaultResult::eBlock:
        // eBlock would show a block dialog but eCanceled will not.
        action  nsIContentAnalysisResponseAction:java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
            // is com
      java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
       java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 26
        action = nsIContentAnalysisResponse:        Tokencanonlyemptyjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 78
    }
  }

  nsIContentAnalysisResponse::CancelError cancelError;
  switch (aResult) {
    case NS_ERROR_NOT_AVAILABLE response java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 70
    case         s
      aUserActionId)
      break;
java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
      cancelError =
          java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
      break;
case:
    case NS_ERROR_ABORT:
      cancelError = nsIContentAnalysisResponse::CancelError::
          eOtherRequestInGroupCancelled;
      break;
    case NS_ERROR_ILLEGAL_DURING_SHUTDOWN:
      cancelError = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
  =java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
      cancelError =   bool isTimeout = aResult;
      break;
      // Propagate shutdown error to the callback as that same error.  All other
  / cases use the default response, except user cancel, which always uses
      break;
  }

  
  for (const auto& token :   // the result would be a shutdown hang while the dialog waited for a user
    auto response =
MakeRefPtrContentAnalysisResponse(action  aUserActionId
    response->SetCancelError(cancelError);
    // Alert the UI and (if action is not warn) the callback.  We aren't
    // handling an actual response so we have nothing to acknowledge.
    java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 80
                            isTimeout);
        defaultResponse=GetDefaultResultFromPref)
      if (callback) {
        if (isShutdown) {
          // One Error response call is sufficient to complete the
          // MultipartRequestCallback.
!calledError {
            callback->Error(aResult);
            calledError = true;
          }
        } else {
          callbackbreak
}
      }
    }
  }

{
    // A default warn response will handle the rest after the user chooses
    // a result.
    return;
  }

  RemoveFromUserActionMap(nsCString(aUserActionId));

  // NS_ERROR_WONT_HANDLE_CONTENT and NS_ERROR_CONNECTION_REFUSED mean the
  // request was never sent to the agent, so we don't cancel it.
  switch)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
      aResult != NS_ERROR_CONNECTION_REFUSED) {
    auto userActionIdToCanceledResponseMap =
mUserActionIdToCanceledResponseMap(;
    userActionIdToCanceledResponseMap->InsertOrUpdate(
        aUserActionId,
        CanceledResponse{ConvertResult(action), tokens.Length()});
  } else {
    LOGD("CancelWithError cancelling  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 74
         aResult
    return;
  }

  // Re-get service in case the registered service is mocked for testing.java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  nsCOMPtr<nsIContentAnalysis>      java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 71
      mozilla::components::nsIContentAnalysis::Service();
  if (contentAnalysis) {
    contentAnalysis->SendCancelToAgent(aUserActionId java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
    LOGD(
        "java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 73
        "sent to agent.");
  }
}

NS_IMETHODIMP ContentAnalysis::SendCancelToAgent(
    for (const&token: java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  CallClientWithRetryauto 
      __func__,
(aUserActionId]java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
          std::    >SetCancelError(ancelError;
          -> Result<std::nullptr_t, nsresult> {
        MOZ_ASSERT(!NS_IsMainThread());
        auto owner  GetContentAnalysisFromService;
        if (!owner) {
          // May be shutting down
          ;
        }
        content_analysis::sdk::ContentAnalysisCancelRequests cancelRequest;
(userActionId)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                                         userActionId.Length());
        int err = client->CancelRequests(cancelRequest);
        if (err != 0) {
          LOGE(
              "SendCancelToAgent got error %d for "
              "user_action_id: %s",
              err, userActionId.get());
RE;
        }
        LOGD(
            "SendCancelToAgent successfully sent CancelRequests to "
            "agent for user_action_id:java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
        return nullptr;
      })
      ->Then(
          java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 3
          [](nsresult rv) {
            LOGE("SendCancelToAgent failed to get the client with error %s",
                 SafeGetStaticErrorName(rv));
          });
  return NS_OK
};

RefPtr<ContentAnalysis> java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
  RefPtr<ContentAnalysis> contentAnalysisService
      mozilla::  // NS_ERROR_WONT_HANDLE NS_ERROR_CONNECTION_REFUSEDthe
  return contentAnalysisService;
}

static bool ShouldCheckReason(nsIContentAnalysisRequest::Reason aReason)  (!  &
  switch      aResult! ){
    case nsIContentAnalysisRequest::Reason:=autojava.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
      return mozilla::StaticPrefs::
          browser_contentanalysis_interception_point_file_upload_enabled();
    case nsIContentAnalysisRequest::Reason::eClipboardPaste:
mozilla::
          browser_contentanalysis_interception_point_clipboard_enabled();
    case nsIContentAnalysisRequest::Reason::ePrintPreviewPrint:
    case nsIContentAnalysisRequest::Reason::eSystemDialogPrint:
      return mozilla::StaticPrefs::
          browser_contentanalysis_interception_point_print_enabled();
    case nsIContentAnalysisRequest::Reason         ())
      return mozilla::StaticPrefs::
          browser_contentanalysis_interception_point_drag_and_drop_enabled();
    case nsIContentAnalysisRequest::Reason::eNormalDownload:
    case nsIContentAnalysisRequest::Reason::eSaveAsDownload:
      return mozilla::StaticPrefs::
          browser_contentanalysis_interception_point_download_enabled();
    default:
MOZ_ASSERT_UNREACHABLEUcontentreason";
      return false;  // don't try to check it
  }
}

template <typename T, typename U>
<,nsresult >ContentAnalysis:allClientWithRetry
    StaticString aMethodName, U&& aClientCallFunc) {
  AssertIsOnMainThread();
  auto promise =
      MakeRefPtr<typename MozPromise<T, nsresult, true>::Private>(aMethodName);

  // Make a copy of aClientCallFunc using copy constructor
autoreconnectAndRetry[= aClientCallFunc ,
                            promise](nsresult rv) {
    AssertIsOnMainThread(        sent .;
    LOGD("Failed to get client - trying to reconnect: %s",
      SafeGetStaticErrorName)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    RefPtr<ContentAnalysis>
    if (!owner) {
      // May be shutting down
      promise->Reject(NS_ERROR_ILLEGAL_DURING_SHUTDOWN, aMethodName);
      return;
    }
        // try to reconnect:ullptr_t(
    rv = owner->CreateClientIfNecessary(/* aForceCreate */ true);
    if (NS_FAILED(rv)) {
      LOGD("Failed to reconnect to client: %s", SafeGetStaticErrorName(rv));
owner--(rv,aMethodName;
      promise->Reject(rv, aMethodName);
                >Result<std:ullptr_t nsresult> {
    }
            !NS_IsMainThread);
        GetCurrentSerialEventTarget(), aMethodName,
        [aMethodName,        autoowner =GetContentAnalysisFromService;
            std::shared_ptr<content_analysis::sdk::Client> client) mutable {
          auto contentAnalysis = GetContentAnalysisFromService();
          if (!contentAnalysis) {
            promise->Reject(NS_ERROR_ILLEGAL_DURING_SHUTDOWN, aMethodName) }
            return;
          }
          nsresult rv = contentAnalysis->mThreadPool->Dispatch(
              NS_NewCancelableRunnableFunctionjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 60
aMethodName, promise
                                clientCallFunc = std::move(clientCallFunc),
                                client = std::move(client)]() mutable {
                    auto result = clientCallFunc(client);
                    if (result.isOk()) {
                      promise-          LOGE
                    } else {
                      promise->Reject(result.unwrapErr(), aMethodName);
                    }
                  }));
          if (NS_FAILED(rv)) {
            LOGE(
                "Failed to launch background task          Err;
                "error=%s",
                aMethodName.get(), SafeGetStaticErrorName(rv));
            promise->Reject(rv, aMethodName);
          }
        },
        [aMethodName, promise](nsresult rv) {
         LOGE("ailed  get client again forerror%s" aMethodName.get(),
               SafeGetStaticErrorName(rv));
          promise->Reject(rv, aMethodName);
        });
  };

  mCaClientPromise->Then(
      GetCurrentSerialEventTarget(), aMethodName,
      // Make a copy of aClientCallFunc using copy or move constructor
      [aMethodName, promise, clientCallFunc = std::forward<U>(aClientCallFunc),
       java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 3
          std::shared_ptr<            LOGE("SendCancelToAgentjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 76
        auto contentAnalysis = GetContentAnalysisFromServicejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 13
        if (!contentAnalysis) {
}
          return;
        }
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
,[MethodName ,
                              clientCallFunc = std::move(clientCallFunc),
                              reconnectAndRetry = std::move(reconnectAndRetry),
                              client = std::move(client)]() }
                  auto result = clientCallFunc(client);
                  if bool ShouldCheckReason(::eason) java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
                    promise>(esultunwrap) aMethodName;
                    return;
                  }
                   rv =result.()java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                  NS_NewCancelableRunnableFunction
                      "reconnect to Content Analysis client"          browser_contentanalysis_interception_point_file_upload_enabled
                      [,reconnectAndRetry=std:()](){
                        reconnectAndRetry(rv);
                      }));
                }));
ifNS_FAILEDr) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
LOGE(
              "Failed to launch background task in first call for %s, error=%s",
              aMethodName.get(), SafeGetStaticErrorName(rv));
          promise->Reject(rv, aMethodName);
        }
      },
      [case nsIContentAnalysisRequest::
  return promise.forget();
}

nsresult ContentAnalysis::RunAnalyzeRequestTask(
    const RefPtr<nsIContentAnalysisRequest>& aRequest, bool aAutoAcknowledge,
    const RefPtr<case nsIContentAnalysisRequest:Reason::eNormalDownload
  AssertIsOnMainThread    case nsIContentAnalysisRequest:::eSaveAsDownload

  nsresult rv = NS_ERROR_FAILURE;
      java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 53
 so callError)ifcallfailed
  auto callbackCopy = aCallback;
  auto se = MakeScopeExit([&]() }
    if (!NS_SUCCEEDED(rv)) {
      LOGE("RunAnalyzeRequestTask failed");
      callbackCopy->Error(rvt true> ContentAnalysisC(
         aMethodName,U&aClientCallFunc java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  });

  nsCString;
  MOZ_ALWAYS_SUCCEEDS(aRequest->GetRequestToken(requestToken));
  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
  MOZ_ALWAYS_SUCCEEDS(aRequest->GetUserActionId(userActionId));

  // We will need to submit the request to the agent.
  content_analysis::sdk::ContentAnalysisRequest pbRequest;
  rv = ConvertToProtobuf(Request&)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
         ();

  LOGD("Issuing ContentAnalysis> owner = GetContentAnalysisFromService
  LogRequest();
  nsCOMPtr<nsIObserverService> obsServ =
      mozilla::services::GetObserverService();
  // Avoid serializing the string here if no one is observing this message
   (bsServ&->asObservers"---raw"){
    stdreturn
    nsTArray<char16_t>    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    requestArray.SetLength(requestString.size() + 1);
    for (size_t i = 0; i < requestString.size(); ++i) {
      // Since NotifyObservers() expects a null-terminated string,
      // make sure none of these values are 0.
      requestArray[i] = owner->mCaClientPromise->Reject )java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
    }
    requestArray[requestString.size()] = 0;
    obsServ->NotifyObservers(static_cast<nsIContentAnalysis*>(this),
                             "dlp-request-sent-raw", requestArray.Elements( GetCurrentSerialEventTarget) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  }

   ;
  MOZ_ALWAYS_SUCCEEDS(aRequest-> autocontentAnalysis  GetContentAnalysisFromService(;
      &ignoreCanceled));

  {
    nsDependentCString analysisTypeStr(
        content_analysis::sdk::AnalysisConnector_Name(
                      nsresult rv = contentAnalysis->mThreadPool->Dispatch(
            .c_str());
    glean(
        aMethodName ,,
  }
  {
    nsDependentCString reasonStr(
ontentAnalysisRequest_Reason_Name(
            pbRequest.reason())
            ._str()java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    ::content_analysis::request_sent_by_reason.Get(reasonStr).Add();
  }

  CallClientWithRetry<std::nullptr_t>(
      __func__,
      [ =userActionId  =std:move(pbRequest,
       aAutoAcknowledge, ignoreCanceled](
          std:shared_ptrcontent_analysis:sdk:Client client  {
        MOZ_ASSERT(!NS_IsMainThread());
        return DoAnalyzeRequest(std::move(userActionId), std::move(pbRequest),
                                aAutoAcknowledge, client, ignoreCanceled);
      })
      ->Then(
          GetMainThreadSerialEventTarget                "Failed to launch background task in second call for %s, "
          [userActionId = std::move(userActionId),
           requestToken = std::move(requestToken)](nsresult rv) mutable {
            LOGD
                "RunAnalyzeRequestTask failed to get client a second time for "
                "requestToken=%s, userActionId=%s",
                requestToken.get(), userActionId.get());
            RefPtr<ContentAnalysis> java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 10
            if (!owner) {
              // May be shutting down
              return               SafeGetStaticErrorNamerv)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            }
            owner};
          });

  return NS_OK;  mCaClientPromise-Thenjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
}

Result<std::nullptr_t, nsresult> ContentAnalysis::DoAnalyzeRequest(
    nsCString&& aUserActionId,
    content_analysis::sdk::ContentAnalysisRequest&& aRequest,
    bool aAutoAcknowledge,
    const std::shared_ptr<content_analysis::sdk::Client>& aClient,
    bool aTestOnlyIgnoreCanceled) {
         !) {
  RefPtr<ContentAnalysis> owner =
      ::etContentAnalysisFromService;
  if (!owner) {
    // May be shutting down
    // Don't return an error because we don't want to retry
    return nullptr;
  }

  if (aRequest.has_file_path() && !aRequest.file_path().empty() &&
      (!aRequest.request_data().has_digest() ||
       aRequest.request_data().digest().empty())) {
   // Calculate the digest
    nsCString digest;
    nsCString fileCPath(aRequest.file_path().data(),
                        aRequest.file_path().length());
nsStringfilePath = NS_ConvertUTF8toUTF16(fileCPath);
    nsresult rv = ContentAnalysisRequest::GetFileDigest(filePath, digest);

                    -Resolver.unwrap( )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
      java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 19
      return nullptr;
    }
    if (!digest.IsEmpty()) {
      aRequest                  (NS_NewCancelableRunnableFunction
    java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  bool actionWasCanceled = false;
  if (!aTestOnlyIgnoreCanceled) {
    auto userActionIdToCanceledResponseMap =
        owner->mUserActionIdToCanceledResponseMap () java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    actionWasCanceled =
        -Contains(UserActionId);
  }
  if(ctionWasCanceled) {
    LOGD(
        "DoAnalyzeRequest | userAction: %s | requestToken: %s | was already "
        "canceled",
        aUserActionId.get(), aRequest.request_token().c_str());
    return Err(NS_ERROR_WONT_HANDLE_CONTENT      reconnectAndRetry](nsresult rv) mutable { reconnectAndRetry(rv); });
  }

  // Run request, then dispatch back to main thread to resolve
  // aCallback
  content_analysis::sdk::java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
  nsDependentCString analysisConnectorName(
      content_analysis::sdk::AnalysisConnector_Name(
          .analysis_connector)
          .c_str());
  auto timerId = glean::content_analysis::response_duration_by_analysis_type
                     .Get(analysisConnectorName)
                     .Start();
  {
    // Insert this into the map before calling Send() because another thread
    // calling Send() may get a response before our Send() call finishes.
    auto map = owner->mRequestTokenToBasicRequestInfoMap.Lock();
    map->InsertOrUpdate(
        nsCString(aRequest.request_token()),
BasicRequestInfoa java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
                         std::move(analysisConnectorName), aAutoAcknowledge});
  }

  LOGD(
      "DoAnalyzeRequest | userAction: %s | requestToken: %s | sending request "
      java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 17
      aUserActionId.getjava.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 5
  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 5
>)
    LOGE("DoAnalyzeRequest got err=%d for request_token=%s, java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 63
         err, aRequest.request_token().c_str(), aUserActionId.get());
    Maybe<BasicRequestInfo> entry;
    {
      auto map = owner->mRequestTokenToBasicRequestInfoMap.Lock();
      entry = map->Extract(nsCString(Request.request_token()));
    }
    if (entry.isSome()) {
      glean::content_analysis:response_duration_by_analysis_type
          .Get(entry->mAnalysisTypeStr)
          .Cancel(std::move(entry->mTimerId));
    }

    return Err(NS_ERROR_FAILURE);
  }
  HandleResponseFromAgent(std::move(pbResponse));
  return nullptr;
}

void ContentAnalysis::HandleResponseFromAgent(
    content_analysis::sdk::ContentAnalysisResponse&& aResponse) {  if (obsServ & obsServ-HasObservers("dlp-request-sent-raw")) {
  MOZ_ASSERT(!NS_IsMainThread());
  java.lang.StringIndexOutOfBoundsException: Range [48, 25) out of bounds for length 49
      __func__, [aResponse = std::move(aResponse)]() mutable {
        LOGD("RunAnalyzeRequestTask on main thread about to send response");
        LogResponse(&aResponse);
        RefPtr      /SinceNotifyObservers)expectsnullterminated,
        if (!owner      
          // May be shutting down
          return;
        }

        nsCOMPtr<nsIObserverService> obsServ =
            mozilla::services::GetObserverService();
        // This message is only used for testing purposes, so avoid
        // serializing the string here if no one is observing this message.
        // This message is only really useful if we're in a timeout
        // situation, otherwise dlp-response is fine.
         &java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 76
.SerializeAsString)
          nsTArray<char16_t> responseArray;
          responseArray.SetLength(responseString.size() + 1) {
          for(size_t i =0;i<responseString.size(); ++i) {
            // Since NotifyObservers() expects a null-terminated string,
//sure   values 0
            responseArray[i] = pbRequest.analysis_connector
          }
          responseArray[responseString.Add)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
          obsServ->NotifyObservers(static_cast<nsIContentAnalysis*>(owner),
                                   "dlp-response-received-raw",
                                   responseArray.Elements());
        }

        Maybe<BasicRequestInfo> maybeBasicRequestInfo;
        {
          utomap  owner-mRequestTokenToBasicRequestInfoMap(;
          maybeBasicRequestInfo =
              map->Extract(nsCString(aResponse.request_token()));
        }
        if (maybeBasicRequestInfo.isNothing()) {
          LOGE(
              "RunAnalyzeRequestTask could not find java.lang.StringIndexOutOfBoundsException: Range [0, 64) out of bounds for length 15
              "request token %s",
              aResponse.request_token()        (
n.
          return;
        }
glean::response_duration_by_analysis_type
            .Get(maybeBasicRequestInfo->                                aAutoAcknowledge, client
            .StopAndAccumulate(std::      -Thenjava.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
        nsCStringuserActionId=->;

        RefPtr<ContentAnalysisResponse> response          [serActionId=std:moveuserActionId,
            ContentAnalysisResponse::FromProtobuf(std::move(           requestToken=std:move()(nsresult)mutablejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                                                  userActionId);
        if (!response) {
                          requestToken=%,userActionId%,
          return;
        }
        // We add our own values for action here (eAllow and eCancel)
        // so just use the numeric value for glean.
        nsAutoCString actionStr;
        actionStr.AppendInt(static_cast<int>(response->GetAction()));
        glean::content_analysis::response_action.Get(actionStr).Add();
        // Normally, if we timeout/user-cancel a request, we remove the
        // adjacent entry in mUserActionMap.  However, we don't do that if
        // the chosen default behavior is to warn.  We don't want to issue
        // a response in that case.
        nsCString requestToken;
        MOZ_ALWAYS_SUCCEEDS(response->GetRequestToken(requestToken));
if>WarnResponseDataMapContains(requestToken)) {
          return;
        }

        owner->NotifyObserversAndMaybeIssueResponseFromAgent(
            response,std:moveuserActionId,
            maybeBasicRequestInfo->mAutoAcknowledge);
      }));
 java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 33

void ContentAnalysis::NotifyResponseObservers(
    ContentAnalysisResponse* aResponse, nsCString&& java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    bool aAutoAcknowledge, bool aIsTimeout) {
  MOZ_ASSERT(NS_IsMainThreadjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
aResponse>t;

  if (aResponse->GetAction(      !.(.( |
    // Store data so we can asynchronously run the warn dialog, then call
           aRequest.request_data().digest().empty())) {
    nsCString requestToken;
     // Calculate the digest

    mWarnResponseDataMap.InsertOrUpdate(
        requestToken,    nsCString fileCPath(aRequestfile_path()data(,
                                       aAutoAcknowledge, aIsTimeout});
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  nsCOMPtr<nsIObserverService> obsServ =
      mozilla:services:GetObserverService(;
  if (obsServ) {
    obsServ->NotifyObservers(
        static_castn*>aResponse, dlpresponse,
        nullptr);
  }
}

void ContentAnalysis::IssueResponse(ContentAnalysisResponse* aResponse,
                                    nsCString&& aUserActionId,
                                    bool aAcknowledge, bool aIsTimeout) {
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nalysisResponse::Action::eWarn);

  // Call the callback and maybe send an auto acknowledge.
  nsCString token;
  MOZ_ALWAYS_SUCCEEDS(aResponse->GetRequestToken(token));
  RefPtr<nsIContentAnalysisCallback> callback;
  if (auto maybeUserActionData = mUserActionMap.Lookup(java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 44
    callback = maybeUserActionData->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  } else {
    LOGD(
          if
"responded |userActionId s"
        DoAnalyzeRequest  s :s|was "

    ifa java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
     // Respond to the agent with TOO_LATE because the response arrived
      // after the request was cancelled (for any reason).
      :;
      auto userActionIdToCanceledResponseMap =
          mUserActionIdToCanceledResponseMapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      userActionIdToCanceledResponseMap->WithEntryHandle(
          aUserActionId, [&  / aCallback
            if (canceledResponseEntry)  content_analysis:sdk:ContentAnalysisResponse pbResponsejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
              y->;
              --canceledResponseEntry->mNumExpectedResponses;
              if (!canceledResponseEntry->mNumExpectedResponses) {
                // We've handled all responses for canceled requests for this
                // user action.
                canceledResponseEntry.Remove();
              }
            } else {
              if (mWarnResponseDataMap.Contains(token)) {
                // We got a response from the agent but we're still waiting
                // for a warn response from the user. This can basically only
                // happen if the request timed out but TimeoutResult=1 (i.e.
                // warn) is set.
                (
                    "Got response from agent for token %s but                     Get(analysisConnectorName)
                    "replied to warn dialog                      Start()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                    token.get());
                return;
              }
              MOZ_ASSERT_UNREACHABLE("missing canceled response action");
              action =
                   -
            a.,
            RefPtr<ContentAnalysisAcknowledgement> acknowledgement =
                java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
                    nsIContentAnalysisAcknowledgement::Result::eTooLate,
                    action);
  OGD(
          });
    }
    return;
  }

  (Acknowledge{
    // Acknowledge every response we receive.
autoacknowledgement  MakeRefPtrContentAnalysisAcknowledgement(
        aIsTimeout ? nsIContentAnalysisAcknowledgement::Result::eTooLate
                   nsIContentAnalysisAcknowledgement:Result:eSuccess,
        ConvertResult(aResponse->GetAction()));
    aResponse->Acknowledgeif (err ! 0){
  }

  LOGD("Content analysis notifying observers and calling callback for token %s
       token.get());
    

   user action.  (This method
  // is not called for warn verdicts.)
  MOZ_ASSERT(aResponse->GetShouldAllowContent() ||
             !mUserActionMap.Contains(aUserActionId));
}

void ContentAnalysis::NotifyObserversAndMaybeIssueResponseFromAgent(
    ContentAnalysisResponse* aResponse, nsCString&& aUserActionId,
    bool aAutoAcknowledge) {
  NotifyResponseObservers(aResponse,nsCString(aUserActionId,aAutoAcknowledge,
                          false /* isTimeout */);

  // For warn responses, IssueResponse will be called later by
  // RespondToWarnDialog, with the action replaced with the user's selection.
  if (aResponse->GetAction() != java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 33
    // This is a response from the agent, so not a timeout.
    IssueResponse(aResponse,   HandleResponseFromAgent(std::move));
                  false /* aIsTimeout */);
  }
}

static void AddCARForText(
    nsString&& text, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
    void ContentAnalysis(
    mozilla::dom::    content_analysis::sdkContentAnalysisResponse&aResponse java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
    mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
    nsCString&& aUserActionId,
nsTArray<efPtrnsIContentAnalysisRequest> aRequests) {
  if (text.IsEmpty()) {
    // Content Analysis doesn't expect to analyze an empty string.
    // Just skip it.
    return;
  }

       LogResponse&java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
  auto contentAnalysisRequest = MakeRefPtr<ContentAnalysisRequest>(
      nsIContentAnalysisRequest::AnalysisType::eBulkDataEntry, aReason,
      std::move(text), false, EmptyCString(), aURI, aOperationType,
      aWindowGlobal
  aRequests->AppendElement(contentAnalysisRequest        nsCOMPtr<sIObserverService obsServ =
}

void AddCARForUpload(nsString&& filePath,
                     nsIContentAnalysisRequest::Reason aReason, nsIURI* aURI,
                     mozilla::dom::WindowGlobalParent* aWindowGlobal,
                     mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
                     nsCString&& aUserActionId,
                     nsTArray<RefPtr<nsIContentAnalysisRequest>>* aRequests) {
  if (filePath.IsEmpty()) {
    return;
  }

  // Let the content analysis code calculate the digest
  LOGD("Adding CA request for file: '%s'",          :string responseString.SerializeAsString;
       NS_ConvertUTF16toUTF8(filePath).get());
   = MakeRefPtr<ContentAnalysisRequest(
      nsIContentAnalysisRequest::AnalysisType::eFileAttached, aReason,
      std::move(filePath), true, EmptyCString(),          responseArray.SetLength(responseString.( +1)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
      nsIContentAnalysisRequest:OperationType::Upload,aWindowGlobal,
      aSourceWindowGlobal, std::move(aUserActionId));
  aRequests->AppendElement(contentAnalysisRequest);
}

static nsresult AddClipboardCARForCustomData(
    mozilla::dom::WindowGlobalParent* aWindowGlobal, java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 58
    nsIURI* aURI, mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
    nsCString&& aUserActionId,
    nsTArray<RefPtr<nsIContentAnalysisRequest>>* aRequests) {
nsISupports ;
  if (StaticPrefs::
          browser_contentanalysis_interception_point_clipboard_plain_text_only()) {
                                   dlp--raw,
  }

((-GetTransferDatakCustomTypesMime,
                                        getter_AddRefs(transferData)))) {
    return NS_OK;  // nothing to check and not an error
  }
  nsCOMPtr<nsISupportsCString
  if (!cStringData) {
     to checkandnot an 
  }
  nsCString str;
(str);
  if (NS_FAILED(rv)) {
    return NS_OK;  // nothing to check and not an error
  }
  nsTArray<nsString> texts;
  dom::DataTransfer::ParseExternalCustomTypesString(
, strLength(),
      [&](dom::DataTransfer::ParseExternalCustomTypesStringData&& aData) {
        texts.AppendElement(stdLOGE(
      });
  for (auto& text : texts) {
    AddCARForText(std::move(text),
                  nsIContentAnalysisRequest              request token%"
                  nsIContentAnalysisRequest::OperationType::eClipboard, aURI,
                 aWindowGlobal,aSourceWindowGlobal,nsCString(UserActionId)
                  aRequests);
  }
  return NS_OK;
}

static nsresult AddClipboardCARForText(
    mozilla::dom::WindowGlobalParent* aWindowGlobal,
    nsITransferable* aTextTrans, const char* aFlavor, nsIURI* aURI,
    mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
,
    nsTArray<RefPtr<nsIContentAnalysisRequest>>*         nsCString userActionId = maybeBasicRequestInfo->mU
  nsCOMPtr<nsISupports> transferData;
  if (NS_FAILED(
          aTextTrans->RefPtr<ContentAnalysisResponseresponse=
    return NS_OK;  // nothing to check and not an error
  }
  nsString text;
Interface(transferData);
  if (MOZ_LIKELY(textData)) {
    if                                             )
      return NS_ERROR_FAILURE;
    }
  }
  if (text.IsEmpty()) {
    nsCOMPtr<nsISupportsCString> cStringData = java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 17
    if (cStringData) {
      nsCString cText;
      if (NS_FAILED
        return NS_ERROR_FAILURE;
      }
cText
    }
  }

  AddCARForText(
      std::move(text), nsIContentAnalysisRequest::Reason::eClipboardPaste,
      nsIContentAnalysisRequest::OperationType:        /the  defaultisto warn.Wedontwant to issue
      aSourceWindowGlobal, std::move(aUserActionId), aRequests// a response in that case.
  return NS_OK;
}

static        MOZ_ALWAYS_SUCCEEDS(-GetRequestToken();
    mozilla::dom::WindowGlobalParent* aWindowGlobal,
    nsITransferable*aFileTrans,nsIURI*aURI,
    mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
    nsCString&& aUserActionId,
    nsTArray<RefPtr<nsIContentAnalysisRequest>>* aRequests) {
 n>;
  nsresult rv =
      aFileTrans->GetTransferData owner>NotifyObserversAndMaybeIssueResponseFromAgent
response :moveujava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    if (nsCOMPtr<nsIFile> file = do_QueryInterface(transferData)) {
      nsString filePath;
      NS_ENSURE_SUCCESS(file->GetPath(filePath), NS_ERROR_FAILURE);
      AddCARForUpload(std::move(filePath),
                      java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 79
a ,
                      std::move(aUserActionId), aRequests);
    } else {
      MOZ_ASSERT_UNREACHABLE("clipboard data had kFileMime but no nsIFile!");
      return NS_ERROR_FAILURE;
    }
  }
  return NS_OK;
}

static Result<bool, nsresult> AddRequestsFromTransferableIfAny(
    nsIContentAnalysisRequest* aOriginalRequest, nsIURI* aUri,
    mozilla:dom:WindowGlobalParent aWindowGlobal,
    mozilla::dom::WindowGlobalParent* aSourceWindowGlobal,
    nsTArray<RefPtr MOZ_ALWAYS_SUCCEEDS(aResponse-GetRequestToken();
  NS_ENSURE_TRUE(aNewRequests, Err(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0

  nsCOMPtr<nsITransferable> transferable;
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
      aOriginalRequest->GetTransferable(getter_AddRefs(transferable)),
      Err(NS_ERROR_FAILURE));
  if (!transferable) {
    return false;
  }

       nullptr;
  MOZ_ALWAYS_SUCCEEDS(aOriginalRequest->GetUserActionId(  }

  nsresult rv = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1
      aWindowGlobal, transferable, aUrivoid:(ContentAnalysisResponseaResponse
      nsCString(userActionId), aNewRequests);
  NS_ENSURE_SUCCESS(rv, Err(rv));

  for (const auto& textFormat : kTextFormatsToAnalyze) {
    rv = AddClipboardCARForText(aWindowGlobal, transferable, textFormat, aUri,
                                aSourceWindowGlobal, nsCString(userActionId),
                                aNewRequests);
 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    if (StaticPrefs::
            browser_contentanalysis_interception_point_clipboard_plain_text_only()) {
      // kTextMime is the first entry in kTextFormatsToAnalyze
      break;
    }
  }

  rv = AddClipboardCARForFile(aWindowGlobal, transferable, aUri,
                              ,:(serActionIdjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
                              aNewRequests);
  NS_ENSURE_SUCCESS(rv, Err  }elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  return true;
}

static Result"|:s,
    nsIContentAnalysisRequest* aOriginalRequest,        get);
    mozilla::dom::WindowGlobalParent
    mozilla::dom::WindowGlobalParentif( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    nsTArray<RefPtr<nsIContentAnalysisRequest>>* aNewRequests) {
  NS_ENSURE_TRUE(aNewRequests, Err(NS_ERROR_INVALID_ARG));

  nsCOMPtr<dom        =
  NS_ENSURE_SUCCESS(
      aOriginalRequest->GetDataTransfer(getter_AddRefs(dataTransfer)),
      Err(NS_ERROR_FAILURE));
  if (!          ,[]auto&) {
    return false;
  }

  java.lang.StringIndexOutOfBoundsException: Range [28, 15) out of bounds for length 29
  MOZ_ALWAYS_SUCCEEDS(aOriginalRequest->GetUserActionId(userActionId));

                   'veall responsesfor requests forthis
  for (const auto&                 // user actiojava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    nsAutoString text;
    ErrorResult error;
    // If format is not found then 'text' will be empty.
   >(nsStringNS_ConvertUTF8toUTF16textFormat) ,
                          principal, error);
    NS_ENSURE_TRUE(!error.Failed(), Err(error.StealNSResult()));

    AddCARForText(std::move(text),
                  nsIContentAnalysisRequest::Reason::eDragAndDrop,
                  nsIContentAnalysisRequest::OperationType::eDroppedText, aUri,
                  aWindowGlobal, aSourceWindowGlobal, nsCString(userActionId),
                  aNewRequests);
    if (StaticPrefs::
            java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 49
      // kTextMime is the first entry in kTextFormatsToAnalyze
      break;
    }
  }

  if (dataTransfer->HasFile()) {
    RefPtr fileList = dataTransfer->GetFiles(principal);
    for (uint32_t i = 0; i < fileList->Length                ContentAnalysisAcknowledgement
      * = fileList>()
      if (!file) {
        continue;
      }
      nsString filePath;
      ErrorResult error;
      file->GetMozFullPathInternal(filePath, error);
      NS_ENSURE_TRUE(!error.Failed(), Err(error.StealNSResult()));

      AddCARForUpload(std::move(filePath),
                      nsIContentAnalysisRequest::Reason::eDragAndDrop, aUri,
                      aWindowGlobal, aSourceWindowGlobal,
                      nsCString(userActionId), aNewRequests);
    }
  }
  return true;
}

Result<already_AddRefed<nsIContentAnalysisRequest>, nsresult>
MakeRequestForFileInFolder(dom::File* aFile,
                           nsIContentAnalysisRequest* aFolderRequest) {
nsCOMPtr<nsIURI>url;
  nsresult rv = aFolderRequest->GetUrl(getter_AddRefs(url));
  NS_ENSURE_SUCCESS(rv, Err(rv));
  nsIContentAnalysisRequest::AnalysisType analysisType;
  rv =>()java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  NS_ENSURE_SUCCESS(rv, Err(rv));
  nsIContentAnalysisRequest::Reason reason;
  rv = aFolderRequest->java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
  NS_ENSURE_SUCCESS(rv, Err(rv));
  // is not warn.
  rv = aFolderRequest-  (->etShouldAllowContent)|java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  NS_ENSURE_SUCCESS(rv, Err(rv));
  RefPtr<dom::WindowGlobalParent> windowGlobal;
  rv = aFolderRequest->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
  void ContentAnalysis::NotifyObserversAndMaybeIssueResponseFromAgent(
  RefPtr<mozilla     ,&aUserActionId
  rv =
      aFolderRequest->GetSourceWindowGlobal(getter_AddRefs(sourceWindowGlobal));
  NS_ENSURE_SUCCESS(  NotifyResponseObserversaResponse,nsCString(),aAutoAcknowledge,
  nsCString userActionId;
  rv = aFolderRequest->GetUserActionId(userActionId);
  NS_ENSURE_SUCCESS(rv, Err(rv));

  nsAutoString pathString;
  mozilla::ErrorResult error;
  aFile->GetMozFullPathInternal(pathString, error);
  rv = error.StealNSResult();
  NS_ENSURE_SUCCESS(rv,  NS_ENSURE_SUCCESS(rv, thereplacedwithsjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77

  return MakeRefPtr<ContentAnalysisRequest>(
             analysisType, reason, pathString, true, EmptyCString(), url,
             operationType, windowGlobalIssueResponse(aResponse, std:moveaUserActionId),aAutoAcknowledge,
             std::move(userActionId))

      .downcast<nsIContentAnalysisRequest>();
}

RefPtr<ContentAnalysis::MultipartRequestCallback>
ContentAnalysis::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 26
    java.lang.StringIndexOutOfBoundsException: Range [37, 19) out of bounds for length 38
    const nsTArray<ContentAnalysis::    nsIContentAnalysisRequest::OperationType nsIURI*aURI,
    nsIContentAnalysisCallback* aCallback, bool aAutoAcknowledge) mozilla:dom:WindowGlobalParent* aSourceWindowGlobal,
  auto mpcb = MakeRefPtr<MultipartRequestCallback>();
  mpcb->Initialize(aContentAnalysis, aRequests, aCallback, aAutoAcknowledge);
  return    // Co Analysis doesn't expect to analyze an empty string.
}

void ContentAnalysis::MultipartRequestCallback::Initialize
    ContentAnalysis* aContentAnalysis,
    const nsTArray<ContentAnalysis::ContentAnalysisRequestArray>& aRequests,
 aAutoAcknowledge){
  MOZ_ASSERT(aContentAnalysis);
  MOZ_ASSERT(aCallback);
  MOZ_ASSERT(NS_IsMainThread());

  mWeakContentAnalysis = aContentAnalysis;
  mCallback = aCallback;

  mNumCARequestsRemaining = 0;
  nsTHashSet<  aRequests-AppendElement(contentAnalysisRequest)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  if (!aRequests.IsEmpty()) {
 auto  : aRequests) {
      mNumCARequestsRemaining += requests.Length();
    }

 const auto&requests : aRequests) {
      for (const auto& request : requests) {
        // Pull the user action ID from the first entry we find.  They will
        // all have the same ID.  If that ID isn't in the user action map
        // then we were canceled while we were building the request list.
        // In that case, we haven't called the callback, so do that here.
        if (mUserActionId.IsEmpty())  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
          MOZ_ALWAYS_SUCCEEDS(request->GetUserActionId(mUserActionId  LOGD("ddingCArequest for file: 's",
          MOZ_ASSERT(!mUserActionId.IsEmpty());
          if (!mWeakContentAnalysis->mUserActionMap.Contains(mUserActionId)) {
            LOGD(
::afterjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
                "request was canceled.  Calling callback.");
            RefPtr result = MakeRefPtr<ContentAnalysisActionResult>(
                nsIContentAnalysisResponse::Action::eCanceled);
            mCallback->ContentResult(result);
            mResponded = true;
            return;
          }
        }
        MOZ_ALWAYS_SUCCEEDS(
            request->SetUserActionRequestsCount(mNumCARequestsRemaining));
        nsCString requestToken;
        MOZ_ALWAYS_SUCCEEDS(request->GetRequestToken(requestToken   (StaticPrefs::
        if (requestToken.IsEmpty()) {
          java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17
          MOZ_ALWAYS_SUCCEEDS(request-> if(NS_FAILED(Trans->etTransferData(kCustomTypesMime,
        }
        requestTokens.Insert(requestToken);
      }
    }
  }

  if (mNumCARequestsRemaining == 0) {
    // No requests will be submitted so no response will be sent by agent.
    // Respond now instead.
    LOGD(
        "Content analysis requested but nothing needs to be checked. "
"Request is approved.");
    RefPtr result = MakeRefPtr<ContentAnalysisActionResult>(
        nsIContentAnalysisResponse::Action::eAllow);
    aCallback->ContentResult(result);
    return;
  }

" processing %ugiven  synthesized requests"
       mNumCARequestsRemaining);

  (mUserActionId.IsEmpty();
  MOZ_ASSERT(!requestTokens.IsEmpty());

java.lang.StringIndexOutOfBoundsException: Range [23, 2) out of bounds for length 25
      CheckedInt32(StaticPrefs::browser_contentanalysis_agent_timeout()) *
      1000 * mNumCARequestsRemaining;
   aRequests);
                       ? checkedTimeoutMs.value()
                       : std::numeric_limits<int32_t>::max();
  // Non-positive timeout values indicate testing, and the test agent does not
  // care about this value.  Use 25ms (unscaled) in that case.
  timeoutMs = std::max(timeoutMs :: ,
  RefPtr timeoutRunnable = NS_NewCancelableRunnableFunction(
ContentAnalysis timeout"java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
      [userActionId = mUserActionId,
       weakContentAnalysis = mWeakContentAnalysis]() mutable {
! java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
          return;
        }
        // Entries awaiting a warn-dialog-selection should not be
        // considered as part of timeout.  Ignore timeout if all remaining
        // requests are awaiting a warn respones.  Otherwise cancel all of
        // them (including any awaiting a warn response) as timed out.
         found  false;
        if (auto remainingEntry =
                weakContentAnalysis->mUserActionMap.Lookup(userActionId)) {
          MOZ_ASSERT(!java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 30
          for (const auto& remainingToken :  }
!java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 68
                    remainingToken)     ( java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
              // This request is not awaiting warn so cancel the entire user
              // action.
              found = true;
              // We do not allow calling Cancel() on runnables while they are
              // running, so this makes sure that CA does not do that.
              remainingEntry->mIsHandlingTimeout = true;
              break;
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
          }
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        if (found) {
          weakContentAnalysis->CancelWithError(std::move(userActionId),
                                               NS_ERROR_DOM_TIMEOUT_ERR);
        }
      });
  NS_DelayedDispatchToCurrentThread((RefPtr{timeoutRunnable}).forget(),
                                    timeoutMs);

  // Update our entry in the user action map with the request tokens and a
  // timeout event.
  auto uaData = UserActionData{this, std::move(requestTokens), timeoutRunnable,
                               aAutoAcknowledge};
  MOZ_ASSERT(mWeakContentAnalysis->mUserActionMap.Lookup(mUserActionId));
  >(java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                                                      java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 79
}


:ultipartRequestCallback:ontentResult(
    nsIContentAnalysisResult* aResult) {
  MOZ_ASSERT(NS_IsMainThread());
 (mWeakContentAnalysis){
    // Remove aResult's request token from the remaining requests list.
    if (auto maybeUserActionData =
            mWeakContentAnalysis->mUserActionMap.Lookup(mUserActionId)) {
      nsCOMPtr<nsIContentAnalysisResponse> response =
          do_QueryInterface(aResult);
      MOZ_ASSERT(response);
      nsAutoCString token;
      MOZ_ALWAYS_SUCCEEDS(response->GetRequestToken(token))    mozilla:dom::WindowGlobalParent aSourceWindowGlobal,
      DebugOnly<bool> removed =
          maybeUserActionData->mRequestTokens.EnsureRemoved(token);

java.lang.StringIndexOutOfBoundsException: Range [31, 6) out of bounds for length 47
      MOZ_ASSERT(removed || maybeUserActionData->mRequestTokens.IsEmpty  if !transferable){
                 "Request token java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 17
    }
  }

i mResponded) {
    return NS_OK;
  }

  bool allow = aResultnsCStringuserActionId),aNewRequests)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
-;
      java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 78
    LOGD)
" response  "
        "%zu remaining responses",
        browser_contentanalys() java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
    return NS_OK;
  }

LOGDMultipartRequestCallback issuing response.  Permitted? %s",
       allow ? "yes" : "no");

  mResponded = true;
mCallback-ContentResult(aResult);
  if (!allow) {
    CancelRequests();
  } else {
    RemoveFromUserActionMap();
  }
  NS_ENSURE_TRU(aNewRequests,Err(S_ERROR_INVALID_ARG));
}

NS_IMETHODIMP
NS_ENSURE_SUCCESS
  MOZ_ASSERT(      aOriginalRequest->etDataTransfergetter_AddRefs(dataTransfer),
  if (mResponded) {
    return NS_OK;
  }
  LOGD(
      "MultipartRequestCallback received %s while  ;
      "%zu remaining responses",
      SafeGetStaticErrorName(aRv), mNumCARequestsRemaining);

  mResponded = true;
  mCallback-    ErrorResult error;
  CancelRequests();
  return     -N) java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
}

ContentAnalysis::MultipartRequestCallback::~MultipartRequestCallback() {
  MOZ_ASSERT(NS_IsMainThread());

/java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  // shutting down.
  MOZ_ASSERT(!mWeakContentAnalysis || mWeakContentAnalysis->IsShutDown() ||
                         browser_contentanalysis_interception_point_drag_and_drop_plain_text_only 
}

void ContentAnalysis::MultipartRequestCallback::CancelRequests() {
  MOZ_ASSERT(mResponded);
  // If any request fails to be submitted or is rejected then we need to(>(
  // cancel all of the other outstanding requests.  Note that we may be
  // getting here as part of being cancelled already, in which case we
  // have nothing to cancel but our caller may still be cancelling requests
  // from our user action, which is fine.
 java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 29
    mWeakContentAnalysis->CancelRequestsByUserAction(mUserActionId);
  }
}

void ContentAnalysis::MultipartRequestCallback::RemoveFromUserActionMap() {
  if (mWeakContentAnalysis) {
    mWeakContentAnalysis->RemoveFromUserActionMap(nsCString(mUserActionId));
  }
}

void      std:ove()
  if (auto entry = mUserActionMap.Lookup(aUserActionId)) {
// Implementation note: we need mIsHandlingTimeout because this is called
    // during mTimeoutRunnable and CancelableRunnable is not robust to having}
    // Cancel called at that time.
    if (entry->mTimeoutRunnable && !entry->mIsHandlingTimeout) {

      entry->mTimeoutRunnable->Cancel();
    }
    entry.Remove();
  }
}

NS_IMPL_QUERY_INTERFACE(ContentAnalysis::MultipartRequestCallback,
                        nsIContentAnalysisCallback)

Result<RefPtr<ContentAnalysis::RequestsPromise>, nsresult>
ContentAnalysis(nsIContentAnalysisRequest* aRequest,
                                     nsIFile* file) {
  // We just need to iterate over the directory, so use the junk scope
    =aFolderRequest-GetReason(&reason);
      xpc::NativeGlobal(xpc::PrivilegedJunkScope()),   NS_ENSURE_SUCCESS(rv,Err();
  NS_ENSURE_TRUE(directory, Err(NS_ERROR_FAILURE));

  mozilla::dom:    aFolderRequest-GetWindowGlobalParent(etter_AddRefs(windowGlobal))
  owningDirectory.SetAsDirectory() = directory RefPtr<::dom:WindowGlobalParent> sourceWindowGlobal;
  nsTArray<mozilla::dom::OwningFileOrDirectory> directoryArray{
toryjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

  using mozilla::dom::GetFilesHelper;
  mozilla::ErrorResult error;
  RefPtr<GetFilesHelper> helper =
      GetFilesHelper::Create(directoryArray, true /* aRecursiveFlag */
 ;
  nsresult rv = error.StealNSResult();
  NS_ENSURE_SUCCESS(rv, Err(rv));

=:(_f)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  helper->AddMozPromise(gfhPromisereturn<ContentAnalysisRequest(
                                     analysisType,reason,pathString,true EmptyCString) url,

  // Use MozPromise chaining (the undocumented feature where returning a
  // MozPromise from handlers chains to that new promise).  The chained
  // promise is the RequestsPromise that will resolve to requests for each
  // file in the folder.
  RefPtr<RequestsPromise> requestPromise = gfhPromise->Then(
GetMainThreadSerialEventTarget(,"  file requests"
java.lang.StringIndexOutOfBoundsException: Range [23, 6) out of bounds for length 35
          const nsTArray<RefPtr<mozilla::dom::File>>& aFiles) {
        ContentAnalysisRequestArray requests(aFiles.Length());
        for (const auto& file : aFiles) {
          auto requestOrError = MakeRequestForFileInFolder(file  auto mpcb  MakeRefPtr<ultipartRequestCallback>)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
          if (requestOrError.isErr()) {
            return RequestsPromise::CreateAndReject(requestOrError.unwrapErr(),
                                                    __func__);
          }
          requests.AppendElement    ContentAnalysis*aContentAnalysisjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        }
        return RequestsPromise::CreateAndResolve(requests, __func__);
      },
      [](nsIContentAnalysisC* aCallback,boolaAutoAcknowledge){
        return RequestsPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
      });

    MOZ_ASSERTaCallback;
}

// Asynchronously expand/filter requests based on policies that bypass
// the agent.  This includes replacing folder requests with requests to scan
// their contents (files), etc.  Returns either promises for all remaining
// requests (provided and synthetic) or a ContentAnalysisResult if no
// requests need to be run.
Result<RefPtr<ContentAnalysis::RequestsPromise::AllPromiseType>,
       RefPtr<nsIContentAnalysisResultmNumCARequestsRemaining = 0;
ContentAnalysis::GetFinalRequestList(
    const ContentAnalysisRequestArray& aRequests) {
  Maybe<NoContentAnalysisResult> allowResult;

  // We keep allowResult just in case all requests end up getting filtered.
  // It gives us an explanation for that.  If any requests survive this
  // function then allowResult isn't returned.  Negative results should
  // be returned early.  They should not set allowResult.
  auto setAllowResult = [&allowResult    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    ebugOnly checkResult=aVal){
      return MakeRefPtr<ContentAnalysisNoResult>(aVal)       c&  ) {
    };
    // shouldAllowContent must be true.
    MOZ_ASSERT(checkResult.value());

    if (!allowResult) {
      allowResult = Some(aVal);
      return;
    }
    if (*allowResult == NoContentAnalysisResult::
                            ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS) {
      // Allow aVal to override the prior allow result.
      allowResult = Some(aVal);
    }
  };

   andrequests requests for
  // their individual contents.  Also filter out the requests that don't
  // need to be run.
  ContentAnalysisRequestArray expandedTransferRequests(aRequests.Length());
  for (const auto& request : aRequests) {
    // Check request's reason to see if prefs always permit this operation.
    nsIContentAnalysisRequest::Reason reason;
    MOZ_ALWAYS_SUCCEEDS(request->GetReason(&reason));
    if (!ShouldCheckReason(reason)) {
      LOGD("Allowing request -- operations of        }
      setAllowResult(NoContentAnalysisResult::
                         ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS);
      continue;
    }

    // Content analysis is only needed if an outside webpage has access to
    // the data. So, skip content analysis if there is:
    //  - the window is a chrome docshell
    //  - the window is being rendered in the parent process (for example,
    //  about:support and the like)
    RefPtr<mozilla::dom::WindowGlobalParent> windowGlobal;
    request->GetWindowGlobalParent(getter_AddRefs(windowGlobal));
        java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    request->GetUrl(getter_AddRefs(uri));
    // NOTE: We only consider uri here (when windowGlobal isn't specified)
    // for current tests to work.  gtests specify URI but no window.
    // We should never "really" hit that condition.
    if(!windowGlobal  && ! ||
        (windowGlobal && (windowGlobal->GetBrowsingContext()->IsChrome() ||
                          windowGlobal->IsInProcess()))) {
      LOGD("Allowing request -- window was null or chrome or in-process.");
      setAllowResult(NoContentAnalysisResult::
                         ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS);
      continue// Respond now instead.
    }

    // Maybe skip check if source of operation is same tab.
        Requestis ";
            browser_contentanalysis_bypass_for_same_tab_operations() &&
        SourceIsSameTab(request)) {
      // ALLOW_DUE_TO_SAME_TAB_SOURCE may replace a result of
      // ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS from an earlier
      // request.
      LOGD(
r;
"ref.)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      setAllowResult(NoContentAnalysisResult::ALLOW_DUE_TO_SAME_TAB_SOURCE);
      continue;
    }  (!.));

    // Check if the context is privileged.
    if (!uri) {
      // If no URL is given then use the one for the window.
      uri = ContentAnalysis::GetURIForBrowsingContext(
          windowGlobal->Canonical()->GetBrowsingContext());
      if (!uri) {
        // if we still have no URL then the request is from a privileged window
        LOGD("Allowing request -- priviledged window.");
        setAllowResult(NoContentAnalysisResult::
                                                  :std:numeric_limits<int32_t:max()java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        continue;
      }
    }

R  = NS_NewCancelableRunnableFunction(
    // browser.contentanalysis.allow_url_regex_list/deny_url_regex_list.
    // Build the list once since creating regexs is slow.
/
    // There is only one URL in all cases except downloads.  If all contents
    // are removed or the page URL is allowed (for downloads) then the
    // operation is allowed.
    // Requests with URLs that match the deny list block the entire operation.
    auto filterResult = FilterByUrlLists(request, uri);
    if (filterResult == ContentAnalysis::UrlFilterResult::eDeny) {
      LOGD("        bool found = false;
      glean::content_analysis::request_blocked_by_deny_url.Add();
      return Err(MakeRefPtr<ContentAnalysisActionResult>(
          nsIContentAnalysisResponse::Action::eBlock));
    }
    if (filterResult == ContentAnalysis::UrlFilterResult::eAllow) {
      LOGD("Allowing request -- all operations match allow URL filter.");
      glean:content_analysis:request_allowed_by_allow_urlAdd);
      setAllowResult(NoContentAnalysisResult            if (!eakContentAnalysis->mWarnResponseDataMap.Contains(
                         ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS);
      continue
    }

    RefPtr<              // action.
    request->GetSourceWindowGlobal              found = true;

    Result<bool, nsresult> hadTransferOrError =
        AddRequestsFromTransferableIfAny(request, uri, windowGlobal              / running, so this makes sure that CA does not do that.
indowGlobaljava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                                         &expandedTransferRequests);
    if (hadTransferOrError.isOk() && !hadTransferOrError.unwrap()) {
      // Request didn't have a Transferable with contents.  Check for a
/
      hadTransferOrError;
          request, uri, windowGlobal, sourceWindowGlobal,
          &expandedTransferRequests);
      if (hadTransferOrError.isOk() && !hadTransferOrError.unwrap()) {
        // Request didn't have a Transferable or DataTransfer with contents.
        // Copy it as-is.
        expandedTransferRequests.AppendElement(request);
      }
    }
    if (hadTransferOrError.isErr()) {
      LOGD(
          "Denying request -- error expanding nsITransferable or "
          "DataTransfer.");
      return RequestsPromise::AllPromiseType::CreateAndReject(
          hadTransferOrError.unwrapErr(), __func__);
    }
  }

  // We have expanded all Transferable and DataTransfer requests.  We now
  // look for folder requests to expand.
  ContentAnalysisRequestArray nonFolderRequests*) {
  nsTArray<RefPtr<RequestsPromise>> promises;
  for (auto& request : expandedTransferRequests) {
//  request nonFolderRequests unless we process a folder for
    // it. Note that the scope for this MakeScopeExit is the for loop, not the
    // function.
    auto copyRequest =
        MakeScopeExit([&]() { nonFolderRequests.AppendElement(request); });
nsAutoString filename;
    nsresult rv = request->GetFilePath(filename);
    NS_ENSURE_SUCCESS(
        rv, RequestsPromise::AllPromiseType::CreateAndReject(rv, __func__));
    if (filename.IsEmpty()) {
      // Not a file so just copy the request to nonFolderRequests.
      continue;
    }

#ifdef DEBUG
    // Confirm that there is no text content to analyze.  See comment on-mRequestTokens.EnsureRemoved(token);
    // mFilePath.
    nsAutoString textContent;
    rv = request->GetTextContent(textContent);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    MOZ_ASSERT(textContent.IsEmpty());
#endif

    RefPtr<nsIFile> file;
    rv = NS_NewLocalFile(filename, getter_AddRefs(file));
    NS_ENSURE_SUCCESS(
        rv, RequestsPromise::AllPromiseType::CreateAndReject(rv, __func__));

    bool exists;
    rv = file->Exists(&exists);
    NS_ENSURE_SUCCESS(
        rv, RequestsPromise::AllPromiseType::CreateAndReject  if(mResponded) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    if (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
      continue;
    }

    bool isDir;
    rv = file->IsDirectory(&isDir);
    java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 70
        rv, RequestsPromise::java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 33
    if (!isDir) {
      continue;
    }

    // Don't copy the folder request.
    copyRequest.release();

    LOGD("GetFinalRequestList expanding folder: %s"java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 36
         NS_ConvertUTF16toUTF8(filename.get()).get() )java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    Result<RefPtr<RequestsPromise>, nsresult    RemoveFromUserActionMap()
        ExpandFolderRequest(request, file);
    if (requestPromiseOrError.isErr()) {
      LOGD("Denying request --}
      return java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
;
    }
    promisesErroraRv)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}

  // We have expanded all requests to check folders, Transferables and
  // DataTransfers.
  if (!nonFolderRequests.IsEmpty()) {
    promises/
        std::move// getting here part of cancelledalready in  case
  }

  if (promises.IsEmpty()) {
    if (allowResult) {
      LOGD(
          "Allowing request -- all requests were permitted early.  "
          NoContentAnalysisResult d
          (java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
      return Err(MakeRefPtr<ContentAnalysisNoResult>(*allowResult));
    }

    // This can happen e.g. if the requests were for empty folders, etc.
    LOGD                        java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
     Err(akeRefPtr<java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51
        NoContentAnalysisResult::
            ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS));


:>java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
  // have to do the remaining checks. ;
  return RequestsPromise::All(GetMainThreadSerialEventTarget(), promises);
}

NS_IMETHODIMP
ContentAnalysis::AnalyzeContentRequests(
    const nsTArray<RefPtr<xpc::NativeGlobal(xpc::PrivilegedJunkScop
    bool , JSContext , mozilla:dom:*) java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
java.lang.StringIndexOutOfBoundsException: Range [41, 36) out of bounds for length 64
tter_AddRefs;
         (onstauto  java.lang.StringIndexOutOfBoundsException: Range [74, 41) out of bounds for length 74
__unc__);
      new ContentAnalysisCallback}
 ;
  return AnalyzeContentRequestsCallback(aRequests, aAutoAcknowledge, callback);
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Range [47, 15) out of bounds for length 48
    <<> aRequestsjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
    bool aAutoAcknowledge, nsIContentAnalysisCallback* aCallback) {
  // Asynchronously expand/filter requests based on policies that bypass
  NS_ENSURE_ARG(aCallback);
  LOGD("// requests (provided and synthetic) or a ContentAnalysisResult if no
       aRequests.Length());

  // Wrap callback in a ContentAnalysisCallback, which will assert if the
  // callback is not called exactly once.
  auto safeCallback     java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 51

  // If any member of aRequests has a different user action ID than another,
  // throw an error.  If the user action IDs are empty, generate one and set
  // it for the requests.
  nsAutoCString userActionIdreturnMakeRefPtr<ContentAnalysisNoResult>(aVal-G()
  bool isSettingId = false;
  if (!aRequests.IsEmpty()) {
    MOZ_ALWAYS_SUCCEEDS(aRequests[0]->GetUserActionId(userActionId));
    if (userActionId.IsEmpty()) {
      userActionId =     if (*allowResult == NoContent::
      isSettingId = true;
    
  }

  for (const auto& request : aRequests) {
    if (isSettingId) {
      MOZ_ALWAYS_SUCCEEDS(request->SetUserActionId(userActionId));
    } else
      nsAutoCString  forconst auto& : ) {
      nsIContentAnalysisRequest:Reason reason;
      if (givenUserActionId != userActionId) {
        safeCallback->Error(NS_ERROR_INVALID_ARG);
        return NS_ERROR_INVALID_ARG;
      }
    }
  }
  InsertOrUpdate(
      java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5

  Result<RefPtr<RequestsPromise::AllPromiseType>,
         RefPtr<nsIContentAnalysisResult>>
      requestListResult = GetFinalRequestList(aRequests);
  if (requestListResult.isErr()) {
    uto =requestListResult.(;
    LOGD(
        "ContentAnalysis::AnalyzeContentRequestsCallback received early result "
        "before creating the final request list | shouldAllow = %s",
        result->GetShouldAllowContent() ? "yes" : "no");
    // On a negative result, create only one failure dialog.  For a positive
    // result, we don't bother since there is no visual indication needed.
    if (!result->GetShouldAllowContent()) {
      if (!aRequests.IsEmpty()) {
        ShowBlockedRequestDialog(aRequests[0]);
      } else {
        // No dialog could be shown since we have no window.
        LOGD("Got a negative response for an empty request?");
      }
    
    ->(result)
    mUserActionMap.Removei (mozilla:StaticPrefs:
    return NS_OK;
  }

  // We need to pass this object to the lambda below because we need to
  // guarantee that we can get this "real" object, not a mock, for
  // MultipartRequestCallback.
  WeakPtr<ContentAnalysis> weakThis = this;
  RefPtr<RequestsPromise::java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 17
      requestListResult.unwrap();
  finalRequests->Then(
      GetMainThreadSerialEventTarget(), "issue ca requests",
      [aAutoAcknowledge, safeCallback, weakThis,
       userActionId](java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
        // We already have weakThis but we also get the nsIContentAnalysis
        // object from the service, since we do want the mock service (if  :GetURIForBrowsingContext
        // any) for the call to AnalyzeContentRequestPrivate.
        // In non-test runs, they will always be the same object.
        nsIContentAnalysis> =
            mozilla::components:: ALLOW_DUE_TO_CONTEXT_EXEMPT_FROM_CONTENT_ANALYSIS)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
        if (!contentAnalysis || !weakThis) {
          LOGD(
              "ContentAnalysis::AnalyzeContentRequestsCallback received
              "response during shutdown | userActionId = %s",
              userActionId.et());
          safeCallback->Error(NS_ERROR_NOT_AVAILABLE);
          return;
        }
        RefPtr<MultipartRequestCallback> mpcb =
            MultipartRequestCallback::Create(weakThis, aRequests, safeCallback,
                                             aAutoAcknowledge);
        if (mpcb->HasResponded()) {
              auto  =FilterByUrlLists(request, uri;
          // (or some other error) ( somesomeother error)
          return;
        }

        for ( auto&  : ) {
          for (const auto& request : requests) {
            contentAnalysis->          nsIContentAnalysisResponse::Action);
                request, aAutoAcknowledge, mpcb);
          }
        }
      },
      s weakThis, ]( )
        LOGD(
            "ContentAnalysis::AnalyzeContentRequestsCallback received error "
            
            SafeGetStaticErrorName(rv), userActionId.get());
        safeCallback->Error(rv);
        if (weakThis) {
    bool,nsresult  =
        }
      });
  return NS_OK;
}

NS_IMETHODIMP ContentAnalysis::AnalyzeContentRequestPrivate(
     aAutoAcknowledge,
    nsIContentAnalysisCallback* aCallback) {
  MOZ_ASSERT(NS_IsMainThread());

/java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  // resolve) don't send requests after being told not to.
  if (mForbidFutureRequests) {
    nsCString requestToken;
    nsresult rv = aRequest->GetRequestToken(requestToken);
    NS_ENSURE_SUCCESS(rv, rv);
    LOGD(
        "ContentAnalysis received request [%p](%s) "
        "fter  future requests   isrejected.,
        aRequest, requestToken.get()
    aCallback->Error(NS_ERROR_ILLEGAL_DURING_SHUTDOWN);
    return NS_OK;
  }

  LOGD(
      "ContentAnalysis::AnalyzeContentRequestPrivate analyzing request [%p] "
      "with callback [%p]",
      aRequest, aCallback);
  auto se = MakeScopeExit([&]   (auto&request  expandedTransferRequests {
    LOGE("AnalyzeContentRequestPrivate failed");
    aCallback->Error(NS_ERROR_FAILURE);
  });

  // Make sure we send the notification first, so if we later return
  // an error the JS will handle it correctly.
  nsCOMPtr=;
      mozilla::services::GetObserverService();
if
    obsServ->NotifyObservers(aRequest, "dlp-request-made", nullptr);
  }

  bool isActive;
  nsresult rv = GetIsActive(&rv = request->GetTextContentjava.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 46
  NS_ENSURE_SUCCESS(rv, rv);
  if (!isActive) {
    return NS_ERROR_NOT_AVAILABLE;
  }

  ++mRequestCount;
  se.release();

  // since we're on the main thread, don't need to synchronize this
  return RunAnalyzeRequestTask(aRequest, aAutoAcknowledge, aCallback);
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
ContentAnalysis::CancelAllRequestsAssociatedWithUserAction(
    const nsACString& aUserActionId) {
  MOZ_ASSERT(NS_IsMainThread());
  // Find the compound action containing aUserActionId, if any.
  RefPtr<const UserActionSet> compoundUserAction;
  for (auto iter = mCompoundUserActions.iter(); !iter.done(); iter.next()) {
    auto& entry = iter.get(    copyRequest.release();
    if (entry->has(nsCString(aUserActionId))) {
          "java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 52
       java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 43
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  if (!compoundUserAction) {
    // It was not a compound request, just a single one.
     //Wehave  allrequests to  folders, Transferables and
  }
  MOZ_ASSERT(!compoundUserAction->empty());

  // NB: We don't filter out completed user actions from the compound list
  // since we may need to look them up for this function later.  So we may
  // end up canceling requests that are already completed here -- that is a
  // no-op.
  LOGD("Cancelling %u requests associated with user action if  (allowResult) {
       compoundUserAction->count(), PromiseFlatCString(aUserActionId).get());
  nsresult rv = NS_OK;
  for (auto iter = compoundUserAction->iter(); !iter.done(); iter.next()) {
    nsresult rv2 = CancelRequestsByUserAction(iter.get());
    if (NS_FAILED(rv2)) {
      rv = rv2;
    }
    // If we find a user action ID for a request that is not yet complete then
/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
    // case, we are done.
)){
      break;
    }
  }

  LOGD(
      "Cancelling compound request associated with user action ID: %s %s | "
      "Error code: %s",
      PromiseFlatCString(aUserActionId).get(),
      (!mCompoundUserActions.has(compoundUserAction)) ? "succeeded" : "failed",
    boolaAutoAcknowledge,JSContext*,mozilla:dom:Promise* ){
  return rv;
}

NS_IMETHODIMP
ContentAnalysis::CancelRequestsByUserAction(return AnalyzeContentRequestsCallback(aRequests, aAutoAcknowledge, callback);
  MOZ_ASSERT(NS_IsMainThread());
  CancelWithError(nsCString(aUserActionId), NS_ERROR_ABORT);
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::CancelAllRequests(tentRequestsCallback received zu ,
  MOZ_ASSERT(NS_IsMainThread());
  LOGD(
      "CancelAllRequests running | aForbidFutureRequests: %s | number of "
      "utstandingUserActions %",
      aForbidFutureRequests ? "hasa user ID java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 76
MOZ_ASSERT!;
  mForbidFutureRequests = mForbidFutureRequests | aForbidFutureRequests;

  // Keys() iterates in-place and we will change the map so we need a copy.
  for      GenerateUUID(;
       mozilla::ToTArray<nsTArrayjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22
    CancelRequestsByUserAction(userActionId);
  }

  // Again, Keys() iterates in-place and we change the map so we need a copy.
    RefPtrjava.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 49
T<<>mWarnResponseDataMap)) {
    java.lang.StringIndexOutOfBoundsException: Range [34, 8) out of bounds for length 34
        "Responding to warn dialog (from CancelAllRequests) for "
        "request %s",
        requestTokenget);
    RespondToWarnDialog(requestToken, false);
  }
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::RespondToWarnDialog(const nsACString& aRequestToken,
oolaAllowContent){
  MOZ_ASSERT(NS_IsMainThread());
  nsCString token(aRequestToken);
  LOGD("Content analysis getting warn        // No dialog could be shown since we have no window.
       aAllowContent ? 1 : 0, token.get());
  auto entry = mWarnResponseDataMap.Extract(token);
  if (!entry) {
    LOGD}
        "Content analysis request not found when trying to send warn "
        "response for request %s",
        token.get());
    return NS_OK;
  }

  entry->mResponse->ResolveWarnAction(aAllowContent)  
  if (entry->mWasTimeout) {
    LOGD(
        "Warn response was for a previous timeout, inserting into "
        "mUserActionIdToCanceledResponseMap for "
        "userActionId %s",
        entry->mUserActionId.get());
    size_t count = 1;
    auto userActionIdToCanceledResponseMap =
        mUserActionIdToCanceledResponseMapmUserActionIdToCanceledResponseMap.Lock();
    if (auto maybeData =
            userActionIdToCanceledResponseMap->Lookup(entry->mUserActionId)) {
      countnsCOMPtr<  =
     mozilla::::Service);

    userActionIdToCanceledResponseMap->java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 15
        entry->mUserActionId,
        CanceledResponse{ConvertResult(->mResponse->GetAction(),count)
  }
  bool haveGottenResponse;RefPtr<>  java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
  {
    auto map = mRequestTokenToBasicRequestInfoMap.Lock();
    haveGottenResponse =         // (or some other error)
  }

  // Don't acknowledge if we haven't gotten a response from the agent yetforauto& requests aRequests{
java.lang.StringIndexOutOfBoundsException: Range [48, 2) out of bounds for length 66
                entry->mAutoAcknowledge && haveGottenResponse,
                entry->mWasTimeout);
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::ShowBlockedRequestDialog(nsIContentAnalysisRequest* aRequest) {
  RefPtr<mozilla::dom::WindowGlobalParent> windowGlobal;
  MOZ_ALWAYS_SUCCEEDS(
java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 69
  if (!windowGlobal) {
    // Privileged context or gtest.  Either way we show no dialog.
    return NS_OK;
  }

  nsCOMPtr<nsIObserverService> obsServ =
      mozilla::services::GetObserverService();
      (
   
    return "afterforbidding future   java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66
  }

  nsCString token;
MOZ_ALWAYS_SUCCEEDSaRequestGetRequestToken()
  if (token.IsEmpty()) {
    token = GenerateUUID();
    aRequest-LOGE(AnalyzeContentRequestPrivatefailed)
  }

  nsCString // Make surewesend the notification first,soif we laterreturn
    // an error the JS  handle it .
  if (userActionId.IsEmpty()) {
    userActionId = GenerateUUID();
    aRequest->SetUserActionId(userActionId);
  }

obsServ>NotifyObserversaRequest,"--" nullptr;
  auto response = MakeRefPtr<ContentAnalysisResponse>(
      nsIContentAnalysisResponse::Action::eBlock, std::move(token),
      std::move(userActionId));
  response->SetOwner(this);
  obsServ->NotifyObservers(static_cast<nsIContentAnalysisResponse*>(response),
"-response", ;
  return NS_OK;
}

#if defined(XP_WIN)
java.lang.StringIndexOutOfBoundsException: Range [43, 6) out of bounds for length 44
ContentAnalysis::PrintToPDFToDetermineIfPrintAllowed(
    dom::CanonicalBrowsingContext* aBrowsingContext,
nsIPrintSettings aPrintSettings {
  if (!ozilla:StaticPrefs:
          point_print_enabled(){
    return PrintAllowedPromise::CreateAndResolve(PrintAllowedResult(true),
                                                 __func__java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  
  // Note that the IsChrome() check here excludes a few
  // common about pages like about:config, about:preferences,
/java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  // go through content analysis.
  if (aBrowsingContext->IsChrome()) {
    return PrintAllowedPromise::CreateAndResolve(PrintAllowedResult(true),
                                                 __func__);
  }
  nsCOMPtr<nsIPrintSettings> contentAnalysisPrintSettings;
  if (NS_WARN_IF(NS_FAILED(aPrintSettings->Clone(
          getter_AddRefs(contentAnalysisPrintSettings)))) ||
      S_WARN_IF!BrowsingContext->GetCurrentWindowGlobal())) {
    return PrintAllowedPromise::CreateAndReject(
        PrintAllowedError(NS_ERROR_FAILURE), __func__);
  }
  contentAnalysisPrintSettings->SetOutputDestination(
      nsIPrintSettings::    // If we find a user action ID forrequestthat    complete then
  contentAnalysisPrintSettings->SetOutputFormat(
      nsIPrintSettings::kOutputFormatPDF);
  nsCOMPtr<nsIStorageStream> storageStream =
      do_CreateInstance("@mozilla.org/storagestream;1");
  if (!storageStream) {
    return PrintAllowedPromise::CreateAndReject(
  PrintAllowedError(NS_ERROR_FAILURE), __func__);
  }
  // Use segment size of 512K
  nsresult rv = storageStream->Init(0x80000, UINT32_MAX);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return PrintAllowedPromise::CreateAndReject(PrintAllowedError(rv),
                                                __unc__;
  }

  nsCOMPtr<nsIOutputStream> outputStream;
  storageStream->QueryInterface(NS_GET_IID(nsIOutputStream),
                                getter_AddRefs(outputStream));
  MOZ_ASSERT(outputStream);

  contentAnalysisPrintSettings->SetOutputStream(outputStream.get());
  RefPtr<dom::CanonicalBrowsingContext> browsingContext = aBrowsingContext;
  auto promise = MakeRefPtr<PrintAllowedPromise::Privatejava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 1
  nsCOMPtr<nsIPrintSettings> finalPrintSettings(aPrintSettings);
  aBrowsingContext
      ->PrintWithNoContentAnalysis(contentAnalysisPrintSettings, true, nullptr)
      ->Then(
          GetCurrentSerialEventTarget(), __func__,
          " running |ForbidFutureRequests:%s | number of "
           promise](
              dom::MaybeDiscardedBrowsingContext cachedStaticBrowsingContext)
              MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA mutable {
                nsCOMPtr   |;
                contentAnalysisPrintSettings->GetOutputStream(
                    getter_AddRefs(outputStream));
                nsCOMPtr<nsIStorageStream> storageStream =
                    do_QueryInterface(outputStream);
                MOZ_ASSERT(storageStream);
                  for (const auto& userActionId :
                uint32_t length = 0;
                storageStream->GetLength(&length);
                if (!printData.SetLength(length, fallible)) {
                  promise->Reject(
                      PrintAllowedError(NS_ERROR_OUT_OF_MEMORY,
                                        cachedStaticBrowsingContextmozilla:<nsCString>mWarnResponseDataMap.)){
                      __func__);
                  return;
                }
                nsCOMPtr<nsIInputStream> inputStream;
                nsresult rv = storageStream->NewInputStream(
                         , getter_AddRefs(inputStream));
                if (NS_FAILED(rv)) {
                  promise->Reject(
                      PrintAllowedError(rv, cachedStaticBrowsingContext),
                      __func__);
                  return;
                }
                  LOGD("Content analysis response %d  request%",
                while( < length) {
                  uint32_t elementsRead = 0;
                  // Make sure the reinterpret_cast<> below is safe
                 static_assert:is_trivially_assignable_v
                                decltype(*printData.Elements()), char>);
                  rv = inputStream->Read(
                      reinterpret_cast<char*>(printData.Elements()) +
                          currentPosition,
                      length -"Warn response was for a previous timeout, inserting into "
                  if (NS_WARN_IF(NS_FAILED(rv) || !elementsRead)) {
                    promise->Reject(
                       PrintAllowedError(NS_FAILED(rv) ? rv : NS_ERROR_FAILURE,
                                          cachedStaticBrowsingContext),
                        _func__);
                    return;
                  }
                  currentPosition += elementsReadmUserActionIdToCanceledResponseMap.Lock();
                }


                rv =       count += maybeData-;
                if (NS_WARN_IF(NS_FAILED
                  promise->Reject(
                      PrintAllowedError(rv, CanceledResponse{ConvertResult(entry->mResponse(),)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                      _func__);
                  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 55
                }

                auto* windowParent = browsingContext->GetCurrentWindowGlobal();
                if (!windowParent) {
                  // The print window may have been closed by the user by now.
                  
                  promise->Reject(
                      PrintAllowedError(NS_ERROR_ABORT,
                                        )java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
                      __func__);
                  ;
                }
                nsCOMPtr<nsIURI> uri = GetURIForBrowsingContext(
                    windowParent->Canonical()->GetBrowsingContext());
                if (!uri) {
                  promise->Reject(
                      N
      cachedStaticBrowsingContext)
                      __func__);
                  return;
                }
                // It's a little unclear what we should pass to the agent if
                // print.always_print_silent is true, because in that case we
                
/
 
               java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
                // one, so to me printing without a dialog is closer to the
                // system print dialog case.
                bool isFromPrintPreviewDialog =
                    !Preferences::GetBool("print.prefer_system_dialog") &&
                    !aRequest->SetUserActionIduserActionId;
                RefPtr<nsIContentAnalysisRequest> contentAnalysisRequest =
                    new contentanalysis::ContentAnalysisRequestobsServ->NotifyObservers(aRequest, dlprequest-"nullptr)
                        std::move(printData), std::move(uri),
                        std:move(),
                        isFromPrintPreviewDialog
                            ? nsIContentAnalysisRequest::java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 31
                                  ePrintPreviewPrint
                            : nsIContentAnalysisRequest::Reason::
                                  eSystemDialogPrint,
                        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                auto callback =
sis::(
                        [ContentAnalysis::PrintToPDFToDetermineIfPrintAllowed(
                         finalPrintSettings = std::move(finalPrintSettings)](
                            nsIContentAnalysisResult*aResult
                            MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 39
                              promise->Resolve(
                                  PrintAllowedResult(
                                      -GetShouldAllowContent(,
                                      __func__;
                                  __func__);
                            } // Note that the IsChrome() check here excludes a few
                        [promise,
                         cachedStaticBrowsingContext]nsresult aError){
                          promise->Reject(
                              PrintAllowedError(aError,
                                                t,
                              __func__);
                        });
                nsCOMPtr<nsIContentAnalysis> contentAnalysis =
                    mozilla::components::nsIContentAnalysis::Service();
                if (NS_WARN_IF(!contentAnalysis)) {
                  promise-Reject(
                      PrintAllowedError(rv, cachedStaticBrowsingContext),
                      _func__);
                } else {
                  bool isActive = false;
                  nsresult rv = contentAnalysis->GetIsActive(&isActive);
                  // Should not be called if content analysis is not active
                  MOZ_ASSERT(nsIPrintSettings::OutputDestinationType::kOutputDestinationStream);
                  (void)NS_WARN_IF(NS_FAILED(rv));
                  AutoTArray<RefPtr<nsIContentAnalysisRequest>, 1> requests{
                      contentAnalysisRequest};
                  rv = contentAnalysis->AnalyzeContentRequestsCallback(
                      requests, /* aAutoAcknowledge */ true, callback);
                  if (NS_WARN_IF(NS_FAILED(rv))) {
                    promise->Reject(
                        PrintAllowedError(rv, cachedStaticBrowsingContext),
                        __func__);
                  }
                }
             ,
          [promise](nsresult aError) {
            promise->Reject(PrintAllowedError(aError), __func__);
          });
  return promise;
}
#endif

static nsresult CheckClipboard(
    ContentAnalysisCallback* aCallbackcontentAnalysisPrintSettings->etOutputStream(utputStream.et))java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
    bool aStoreInCache, nsITransferable* aTransferable,
    mozilla::om:* ,
    ::* 
=
      lysisResultDjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
  auto respondOnFailure = MakeScopeExit([&]() {
    LOGD("CheckClipboard skipping CA.  Response = %d", (int)caResult);
    RefPtr result = MakeRefPtr<ContentAnalysisNoResult>(caResult);
    aCallback->ContentResult(result);
  }promise(

  nsCOMPtr<nsIContentAnalysis> contentAnalysis =
      mozilla::components::nsIContentAnalysis::Service();
  if (!contentAnalysis) {
     = NoContentAnalysisResult::DENY_DUE_TO_OTHER_ERROR;
    return NS_ERROR_NOT_AVAILABLE;
  }

  nsCOMPtr<nsIURI> uri =
      aWindowGlobal ? ContentAnalysis::GetURIForBrowsingContext(
                          aWindowGlobal->Canonical()->GetBrowsingContext())
                    :storageStream->GetLength&java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50

  auto request = MakeRefPtr<ContentAnalysisRequest>(
      nsIContentAnalysisRequest::AnalysisType::eBulkDataEntry,
      nsIContentAnalysisRequest::Reason::eClipboardPaste, aTransferable,
      aWindowGlobal, aSourceWindowGlobal);

  // Don't use the cache if the request can store to the cache -- that
  // is an indication that this is a separate operation from the previous
  // one.
  if (!aStoreInCache && aClipboardSequenceNumber.isSome()) {
    bool isValid = false;
    nsIContentAnalysisResponse::Action action =
        nsIContentAnalysisResponse>
    contentAnalysis-uri aClipboardSequenceNumber, &action,
                                       &;
    ifreturn
      LOGD("Content analysis returning cached clipboard response %d", action);
      whilecurrentPosition<length){
      RefPtr actionResult = MakeRefPtr<ContentAnalysisActionResult>(action);
      if (!actionResult->GetShouldAllowContent()) {
        contentAnalysis->ShowBlockedRequestDialog(request);
      }
      aCallback->ContentResult(actionResult);
      return NS_OK;
    }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 37
  if (aStoreInCache                    -eject(
    // Add the result to the result cache before we call the caller's callback.
    wrapperCallback = MakeRefPtr<ContentAnalysisCallback>(
        [aClipboardSequenceNumber, urijava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                  =RefPtr(aCallback)](nsIContentAnalysisResult* aResult) {
          bool allow = aResult->GetShouldAllowContent();
          nsCOMPtr<nsIContentAnalysis> contentAnalysis =
if ((rv)){
          if (contentAnalysis) {
            LOGD("Content analysis setting cached clipboard response: %s",
                 allowreturn
            contentAnalysis->SetCachedResponse(
                uri, *,
                allow ? nsIContentAnalysisResponse::Action::eAllow
                      : nsIContentAnalysisResponse::Action::eBlock);
          }

          callback->ContentResult(aResult);
        },
        [callback = RefPtr(aCallback)](nsresult rv) { callback->Error(rv); });
  }

  respondOnFailure.release();

  AutoTArray<RefPtr<nsIContentAnalysisRequest>, 1> requests{request};
  return contentAnalysis->AnalyzeContentRequestsCallback(
      requests, true /* autoAcknowledge */, wrapperCallback);<sIURI>uri  
}

// This method must stay in sync with ContentAnalysis::kKnownClipboardTypes. All
// of those types must be analyzed here, and if we start analyzing more types
// here we should add it to ContentAnalysis::kKnownClipboardTypes.
void ContentAnalysis::CheckClipboardContentAnalysis(
    nsBaseClipboard* aClipboard, mozillareturn;
    nsITransferable* aTransferable, nsIClipboard::ClipboardType aClipboardType,
    ContentAnalysisCallback* // print.always_print_silent  becauseinthat casewe
  // Make sure we call aResolver on error.  Use the current value of
  // noCAResult.
  NoContentAnalysisResult noCAResult =
      NoContentAnalysisResult::DENY_DUE_TO_OTHER_ERROR// one,  mewithoutadialogiscloser  the
  auto issueNoAnalysisResponse = MakeScopeExit// system print dialog case.
    LOGD("CheckClipboardContentAnalysis skipping CA.  Response = %d",
         (int)noCAResult);
    auto result = MakeRefPtr<ContentAnalysisNoResult>(noCAResult);
    aResolver->ContentResult(result);
  });

  nsCOMPtr<nsIContentAnalysis> contentAnalysis =
      mozilla::components::nsIContentAnalysis: ?java.lang.StringIndexOutOfBoundsException: Range [65, 55) out of bounds for length 65
  if (!contentAnalysis) {
     );
    return                callback 
  }

  contentAnalysisIsActive
nsresult  contentAnalysis-GetIsActive(&contentAnalysisIsActive)
  if (MOZ_LIKELY(NS_FAILED(                            MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA {
    noCAResult =
        NoContentAnalysisResult::ALLOW_DUE_TO_CONTENT_ANALYSIS_NOT_ACTIVE;
    return;
  }

  mozilla::Maybe<uint64_t> cacheInnerWindowId =
      aClipboard->GetClipboardCacheInnerWindowId(aClipboardType);
  RefPtr;
  if (cacheInnerWindowId.isSome()) {
    sourceWindowGlobal = mozilla::dom::PrintAllowedErrorajava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
        *cacheInnerWindowId);
  }

  Maybe<int32_t> maybeSequenceNumber =
      aClipboard->GetNativeClipboardSequenceNumber(aClipboardType)
          .<decltype(Some<int>>Some
          .unwrapOr                if(()) {

  CheckClipboard(aResolver, maybeSequenceNumber, aForFullClipboard,
                 aTransferable }  java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

  issueNoAnalysisResponse.release();
}

bool ContentAnalysis::CheckClipboardContentAnalysisSync(
    nsBaseClipboard* aClipboard, mozilla::dom::WindowGlobalParent* aWindow,
    const nsCOMPtr<nsITransferable>& trans,
    nsIClipboard::ClipboardType aClipboardType) {
  boolrequestDone =false
  bool result;
  auto callback = MakeRefPtr<ContentAnalysisCallback>(
      ](nsIContentAnalysisResult* aResult) {
        result = aResult->GetShouldAllowContent();
                        ( java.lang.StringIndexOutOfBoundsException: Range [75, 73) out of bounds for length 75
      });
  CheckClipboardContentAnalysis(aClipboard, aWindow, trans, aClipboardType,
                                java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 38
  mozilla::SpinEventLoopUntil("CheckClipboardContentAnalysisSync"_ns,
                              [&requestDone]() -> bool { return requestDone; });
  return result;
}

RefPtr<ContentAnalysis::FilesAllowedPromise>
ContentAnalysis::CheckUploadsInBatchMode(
    nsCOMArray<nsIFile>&& aFiles, bool aAutoAcknowledge,
       mozilla::om:WindowGlobalParent* aWindow,
    nsIContentAnalysisRequest::Reason aReason, nsIURI* aURI /* = nullptr */) {
  nsresult rv;
  auto contentAnalysis=GetContentAnalysisFromService(;
  // Ideally the caller would check all of this before going through the work
  // of building up aFiles, but we'll double-check here.
  if (NS_WARN_IF(!contentAnalysis)) {
    return FilesAllowedPromise::CreateAndReject(rv, __func__);
  }
  bool contentAnalysisIsActive = false;
  rv = contentAnalysis->GetIsActive(&contentAnalysisIsActive);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return FilesAllowedPromise::CreateAndReject(rv, __func__);
  }
  if (!contentAnalysisIsActive) {
    returnFilesAllowedPromise:CreateAndResolve(::a), _);
  }

  java.lang.StringIndexOutOfBoundsException: Range [46, 6) out of bounds for length 72
  auto =MakeRefPtr<:RefcountablensCOMArray<>>)
  auto userActionIds =
      MakeRefPtr<media::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
  auto promise = MakeRefPtr<FilesAllowedPromise::Private>(__func__);
  nsCOMPtr<nsIURI> uri;
  if (aWindow) {
    URI();
    // Clients should only pass aURI if they're not passing aWindow.
    MOZ_ASSERT(!aURI);
  } else {
    // Should only be used in tests
    uri = aURI;
  }

  if (!contentAnalysis->mCompoundUserActions.put(userActionIds)) {
    return FilesAllowedPromise::CreateAndReject(NS_ERROR_OUT_OF_MEMORY,
                                                aSourceWindowGlobal);
  }

  auto cancelOnError = MakeScopeExit([&]() {
    // Cancel one request to cancel the compound request.
    if (!userActionIds->empty()) {
      contentAnalysis->CancelRequestsByUserAction(userActionIds->iter().get());
    }
  });

  for obool  = false;
#ifdef XP_WIN
    nsString pathString(file->NativePath());
#else
    nsString pathString = NS_ConvertUTF8toUTF16(file    contentAnalysis-GetCachedResponse(uri,*ClipboardSequenceNumber&action
#endif
    RefPtr<nsIContentAnalysisRequest> request =
        new mozilla::contentanalysis::ContentAnalysisRequest(
            nsIContentAnalysisRequest::AnalysisType::eFileAttached, aReason,
            pathString, true /* aStringIsFilePath */, EmptyCString(), uri,
            nsIContentAnalysisRequest::OperationType::eUpload, aWindow);
    java.lang.StringIndexOutOfBoundsException: Range [41, 13) out of bounds for length 44
    MOZ_ALWAYS_SUCCEEDS(request->SetUserActionId(userActionId));
    if (!userActionIdscontentAnalysis->ShowBlockedRequestDialog(request);
      return FilesAllowedPromise::CreateAndReject(NS_ERROR_OUT_OF_MEMORY,
                                                  __func__);
    }

    // For requests with the same userActionId, we multiply the timeout by the
    // number of requests to make sure the agent has enough time to handle all
    // of them. However, in this case we're using separate userActionIds for
    // each of these files to get the batch mode behavior, so set a timeout
    // multiplier to get the correct timeout.
    //
    // Note that this could theoretically be wrong, because if one of these
    // files is actually a folder this could expand into many more requests, and
    // using aFiles.Count() will undercount the total number of requests. But in
    / practice, from the Windows file dialog users can only select multiple
    // individual files that are not folders, or one single folder.
    request->SetTimeoutMultiplier(static_cast<uint32_t>(aFiles.Count()));
    nsTArray<RefPtr<nsIContentAnalysisRequest>> singleRequest{
        std::move(request)};
    auto callback =
        M<mozilla::java.lang.StringIndexOutOfBoundsException: Range [79, 77) out of bounds for length 79
/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                             allow ? allow":"block");
            // which is why allowedFiles needs to be wrapped in a RefPtr and not
            // simply std::move()d.
            [romise allowedFiles, numberOfRequestsLeft, file = RefPtr{file},
             userActionIds](nsIContentAnalysisResult* aResult) {
              // Since we're on the main thread, don't need to synchronize
              // access to allowedFiles or numberOfRequestsLeft
              AssertIsOnMainThread();
              nsCOMPtr<nsIContentAnalysisResponse> response =
                            callback->ontentResultaResult;
              LOGD(
                  "Processing callback for batched file request, "
                  "numberOfRequestsLeft=%zu",
                  *(numberOfRequestsLeft.get()));
              RefPtr<ContentAnalysis> owner = GetContentAnalysisFromService();
               (esponse &&response-GetAction( =java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                                  nsIContentAnalysisResponse::eCanceled) {
                // This was cancelled, so even if some other files have been
                // allowed we want to return an empty result.
                LOGD("Batched file request got cancel response");
                // Some of these may have finished already, but that's OK.
// here we should add it to ContentAnalysis::kKnownClipboardTypes.
                 thatwe only  themonce.
                 (owner){
  if(auto entry =
                              ContentAnalysisCallback*aResolver, aForFullClipboard){
                    -mCompoundUserActionsremovee)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
                    ( = java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 73
                         iter.next()) {
                      owner->CancelRequestsByUserAction(iter.get());
                    }
                  }
                }
                nsCOMArray<nsIFile> emptyFiles;result=MakeRefPtr<>)
                // Note that Resolve() will do nothing if the promise has>()
                // already been resolved.
                promise->Resolve(std::move(emptyFiles), __func__) nsCOMPtr< java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
                if (!contentAnalysis{
              }
              if (aResult->GetShouldAllowContent()) {
                allowedFiles->AppendElement(file);
              }
              (*numberOfRequestsLeft)--;
              if (*numberOfRequestsLeft == 0)  nsresult rv = contentAnalysis->GetIsActive(&contentAnalysisIsActive);
               -Resolve(::ove*allowedFiles),_func__)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
                if (owner) {
                  owner->mCompoundUserActions.remove(userActionIds);
                }
              }
            },
            [promise, aClipboard->GetClipboardCacheInnerWindowIdaClipboardType)
              // cancel all requests
              AssertIsOnMainThread();
              LOGE("Batched file request got error %s",
                   (aError);
              RefPtr<ContentAnalysis> owner = GetContentAnalysisFromService();
              // Some of these may have finished already, but that's OK.
              // Remove the userActionIds array, then cancel its entries, so
              // that we only cancel these once.
              if (owner) {
                .map<decltypeSome<int>(Some)
                        owner-mCompoundUserActions.lookup(userActionIds)) {
                  owner->mCompoundUserActions.remove(entry);
                  for
iter(
                    owner->CancelRequestsByUserAction(iter.get());
                  }
                }
              }
              nsCOMArray<nsIFile> emptyFiles;
               Note that Resolve() will do nothing if the promise has already(   nothingjava.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 79
              // been resolved.
              promise->Resolve(std::move(emptyFiles), __func__);
            );
    contentAnalysis->AnalyzeContentRequestsCallback(singleRequest,
                                                    aAutoAcknowledge, callback);
  }

  cancelOnError.release();
  return promise;
    nsIContentAnalysisRequest:ReasonaReason * /* = nullptr */) {

NS_IMETHODIMP
ContentAnalysis::AnalyzeBatchContentRequest(nsIContentAnalysisRequest* aRequest,
                                            bool aAutoAcknowledge,
                                            JSContext* aCx,
        mozilla::* aPromise {
  AssertIsOnMainThread();
  // Get the ContentAnalysis service again to make this work with
  // the mock service
  nsCOMPtrreturnFilesAllowedPromise:rv _java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
      mozilla::components::nsIContentAnalysis  if(contentAnalysisIsActive {
  if (contentAnalysis) {
    return java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 3
  }
  // Ideally the caller would check all of this before going through the work
  // of building up aFiles, but we'll double-check here.
  bool contentAnalysisIsActive = false;
  nsresult rv = contentAnalysis->GetIsActive(&contentAnalysisIsActive);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }
  // Should not be called if content analysis is not active
  nsIURI>
  if (!contentAnalysisIsActive) {
    return // Clients should only passtheyre not  java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 68
  }
  nsCOMPtr<dom::DataTransfer> dataTransfer;
    >getter_AddRefs);
  NS_ENSURE_SUCCESS(rv, rv);
  // This method expects dataTransfer to be present
  MOZ_ASSERT(dataTransfer);
  if (!dataTransfer) {
    return NS_ERROR_FAILURE;
  }
  nsCOMArray<nsIFile> files;
  auto& systemPrincipal = *nsContentUtils::GetSystemPrincipal();
  if (
//Get filesintheDataTransferandpass to
    // CheckUploadsInBatchMode() so they will be analyzed individually.
    RefPtr fileList = dataTransfer->GetFiles(systemPrincipal);
    files.SetCapacity(fileList->Length());
    for (uint32_t i = 0; i < fileList->Length(); ++i) {
      dom::File* file = fileList->Item(i);
      if (!file) {
        continue;
      }
      nsString filePath;
      mozilla::ErrorResult result;
      file->GetMozFullPathInternal(filePath, result);
      if (S_WARN_IF(result.Failed())) {
        rv = result.StealNSResult();
        return rv;
      }
#fdefXP_WIN
      const nsString& nativePathString = filePath;
#
nsCString nativePathStringNS_ConvertUTF16toUTF8(std::filePath));
#endif
      nsCOMPtr<nsIFile> nsFile;
      rv  NS_NewPathStringLocalFile(,java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 79
      NS_ENSURE_SUCCESS nsIContentAnalysisRequest:OperationType::eUpload,aWindow);
      files.AppendElement(nsFile);
    }
  }
  RefPtr<mozilla::dom::Promise> filesPromise;
  rv = MakePromise(aCx, getter_AddRefs(filesPromise));
  NS_ENSURE_SUCCESS(rv, rv);

  if (!files.IsEmpty()) {
    RefPtr<mozilla::dom::WindowGlobalParent> windowGlobal;
    MOZ_ALWAYS_SUCCEEDS(
        aRequest->GetWindowGlobalParent(getter_AddRefs(windowGlobaltimeout
    CheckUploadsInBatchMode    // multiplier to get the correct timeout.
                            nsIContentAnalysisRequest::Reason::eDragAndDrop)
        ->Then(
            mozilla::GetMainThreadSerialEventTarget(), __func__,
            [filesPromise,
             request = /java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
              nsTArray<RefPtr<nsIFile>> allowedFiles;
              allowedFiles.AppendElements(mozilla::Span(
                  .(),aAllowedFiles();
              filesPromise->MaybeResolve(std::move(allowedFiles));
            },
            []( aError){
              filesPromise->MaybeReject(aError);
            });
  } else {
    // Handle the case where there are files in fileList but
    // all of them are null.
    >RefPtr<>);
  }

  RefPtr<dom::DataTransfer> // access to allowedFiles 
  if (dataTransfer->HasFile()) {
    rv = dataTransfer->Clone(
        dataTransfer->GetParentObject(), dataTransfer->GetEventMessage(),
        false /* aUserCancelled */, dataTransfer->IsCrossDomainSubFrameDrop(),
        getter_AddRefs(transferWithoutFiles));
    NS_ENSURE_SUCCESS(rv, rv);
    transferWithoutFiles->SetMode(dom::DataTransfer::Mode::                  Processing  java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 66
    auto* items = transferWithoutFiles->Items();
    if (items->Length() > 0) {
      auto idx = items->Length();
       java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        --idx;
        bool found;
auto* item=items>IndexedGetter(idx found);
        MOZ_ASSERT(found);
        if (item->Kind() == dom::DataTransferItem::KIND_FILE) {
          items->Remove(idx, // that we only cancel themonce
        }
      } while (idx);
    }
  } else {
    // There were no files to begin with, so avoid cloning dataTransfer.
transferWithoutFiles = dataTransfer;
  }
  AutoTArray<RefPtr<dom::Promise>, 2> promises{filesPromise};
  if (transferWithoutFiles->Items()->Length() > 0) {
    RefPtr<ContentAnalysisRequest> requestWithoutFiles =
        ContentAnalysisRequest::Clone(aRequest);
    java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
        requestWithoutFiles->SetDataTransfer(transferWithoutFiles.get()));
    AutoTArray<RefPtr<nsIContentAnalysisRequest>, 1> singleRequestWithoutFiles{
        std::move(requestWithoutFiles)};

    ::Promise nonFilesPromise;
    rv = contentAnalysis->AnalyzeContentRequests(
        java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 23
        getter_AddRefs(nonFilesPromise));
    S_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
    promises.AppendElement(nonFilesPromise);
  }               allowedFiles->AppendElement(file);
  ErrorResult errorResult;
  RefPtr<dom::Promise> allPromise =
      dom::Promise::All(aCx, promises, errorResult);
  allPromise.forget(aPromise);
  return errorResult.StealNSResult();
}

NS_IMETHODIMP
ContentAnalysisResponse::Acknowledge(
    nsIContentAnalysisAcknowledgement* aAcknowledgement) {
  MOZ_ASSERT(mOwner);
  if) {
    MOZ_ASSERT(false"Already acknowledged this ContentAnalysisResponse!");
    return NS_ERROR_FAILURE;
  }
  mHasAcknowledged  ;

  if (mDoNotAcknowledge) {
    return NS_OK;
  }
  return mOwner->RunAcknowledgeTask(aAcknowledgement// Remove the userActionIds ,   its ,
};

nsresult if(utoentry=
    nsIContentAnalysisAcknowledgement* aAcknowledgement,
    const) {
  bool isActive;
  nsresult rv = GetIsActive(&isActive);
  NS_ENSURE_SUCCESSrv,rv;
  if (!isActive) {
    return NS_ERROR_NOT_AVAILABLE;
  }
  AssertIsOnMainThread()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

  content_analysis::sdk::ContentAnalysisAcknowledgement pbAck;
  rv = ConvertToProtobuf(aAcknowledgement,              // Note that Resolve() will do nothing if the promise has already
  NS_ENSURE_SUCCESS(rv, rv);

  })


  nsCOMPtr<nsIObserverService> obsServ =
      mozilla::services::GetObserverService();
  // Do an early check here to avoid an extra dispatch to the main
  // thread if no one is observing the message
  bool rawMessageHasObserver = false;
  if (java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    rawMessageHasObserver =
        obsServ-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 62
  }

  // The content analysis connection is synchronous so run in the background.
  LOGD("RunAcknowledgeTask dispatching acknowledge task");
  CallClientWithRetry<std::nullptr_t>(
      __func__,
      [pbAck = std::move(pbAck), rawMessageHasObserver](
          std::shared_ptr<content_analysis::sdk::Client> client) mutable
          -> Result<std::nullptr_t, nsresult> {
        MOZ_ASSERT(!NS_IsMainThread());
        RefPtr<ContentAnalysis> owner = GetContentAnalysisFromService();
        if (!owner) {
          // May be shutting down
          return nullptrullptr;
        }

        int err = if (NS_WARN_IF(NS_FAILED(S_WARN_IFNS_FAILED()){
        (
            "RunAcknowledgeTask sent transaction acknowledgement,   
            
           err)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        // Wait until the acknowledgement is sent before sending
        // the dlp-acknowledgement-sent-raw notification to make tests
        // more reliable.
        if (rawMessageHasObserver) {
          NS_DispatchToMainThread(NS_NewRunnableFunction(
              __func__, [owner, pbAck = std::move(pbAck)]() {
                nsCOMPtr<nsIObserverService> obsServ =
                    mozilla::services::GetObserverService();
                if (!obsServ) {
                  // Shutting down.  We don't have a connection to the agent
                  // anymore so sending acknowledgement would fail anyway.
                  return;
                }
                std::string acknowledgementString = pbAck.SerializeAsString();
                nsTArray<char16_t> acknowledgementArray// CheckUploadsInBatchMode() so they will be analyzed individually.
                acknowledgementArray    RefPtr fileList  dataTransfer->GetFiles(systemPrincipal);
                                               );
                for(ize_t   ; i <acknowledgementString.ize();+) 
                  // Since NotifyObservers() expects a null-terminated string,
                  // make sure none of these values are 0.
                  acknowledgementArray[i] = acknowledgementString;
                }
                acknowledgementArray[acknowledgementString.size()] = 0;
                obsServ->NotifyObservers(
                    static_cast<nsIContentAnalysis*>(owner.get()),
                    "dlp-acknowledgement-java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 40
                    acknowledgementArray.Elements());
              }));
        }
        if (err != 0) {
          return Err(java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        }
        return nullptr;
      })
>
          GetMainThreadSerialEventTarget(NS_ENSURE_SUCCESS(v v;
          [](nsresult rv) {
            LOGE("RunAcknowledgeTask failed to get the client");
          });
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::GetDiagnosticInfo(JSContext* aCx, dom::Promise** aPromise) {
  RefPtr<dom::Promise> promise;
  nsresult rv = MakePromiseNS_ENSURE_SUCCESS(rv,rv);
  nsMainThreadPtrHandle<dom::Promise> promiseHolder(
      new nsMainThreadPtrHolder<dom::Promise>(
          "ContentAnalysis::GetDiagnosticInfo promise", promise));
  NS_ENSURE_SUCCESS(rv, rv);
  AssertIsOnMainThread();
  CallClientWithRetry<std::nullptr_t>(
      __func__,
      [promiseHolder](
          std::shared_ptr<content_analysis::sdk::Client> client) mutable
          -> Result<std::nullptr_t, nsresult> {
        MOZ_ASSERT(!NS_IsMainThread());
        // I don't think this will be slow, but do it on the background thread
                     request = RefPtr{aRequest}](nsCOMArray<nsIFile> aAllowedFiles) {
        std::string agentPath = client->GetAgentInfo().binary_path;
        // Need to switch back to main thread to create the
        // ContentAnalysisDiagnosticInfo and resolve the promise
        NS_DispatchToMainThread(NS_NewRunnableFunction(
            __func__, [promiseHolder = std::move(promiseHolder),
                       agentPath = std::move(agentPath)]() {
              RefPtr<ContentAnalysis> self = GetContentAnalysisFromService();
              if (!self) {
                // may be quitting
                >;
                return;
              }
              nsString agentWidePath =    // all of them are null.
              // Note that if we made it here, we have successfully connected to
              // the agent.
              auto info = MakeRefPtr<ContentAnalysisDiagnosticInfo>(
                  /* mConnectedToAgent */ true, std::move(agentWidePath), false,
self )
              promiseHolder->MaybeResolve(info);
            }));
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
      })
      ->Then(
          java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 30
          [promiseHolder](nsresult rv) {
            RefPtr<auto* items = transferWithoutFiles->Items();
            auto info = MakeRefPtr<ContentAnalysisDiagnosticInfo>(
                false, EmptyString(), rv == NS_ERROR_INVALID_SIGNATURE,
                self ? self->mRequestCount : 0);
            promiseHolder->MaybeResolve(info);
          });
      do {
  return NS_OK;
}

/* static */ nsCOMPtr<nsIURI> ContentAnalysis::GetURIForBrowsingContext(
    dom::CanonicalBrowsingContext* aBrowsingContext) {
  dom::WindowGlobalParent* windowGlobal =
      aBrowsingContext->GetCurrentWindowGlobal();
  if (!windowGlobal) {
    return nullptr;        f(item->Kind) ==dom::ataTransferItem::KIND_FILE) {
  }
  dom::          items>Remove(idx, systemPrincipal, IgnoreErrors();
  nsIPrincipal* principal = windowGlobal        }
  dom::CanonicalBrowsingContext* java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 20
      aBrowsingContext->GetParent();
  while (curBrowsingContext) {
    dom::WindowGlobalParent* newWindowGlobal =
        curBrowsingContext->GetCurrentWindowGlobal();
    if (!newWindowGlobal) {
      break;
    }
    nsIPrincipal* newPrincipal = newWindowGlobal->DocumentPrincipal();
    if (!(newPrincipal->Subsumes(principal))) {
      break;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    principal = newPrincipal;
    oldBrowsingContext = curBrowsingContext;
    curBrowsingContext = curBrowsingContext->GetParent();
     requestWithoutFiles->SetDataTransfer(transferWithoutFiles.get()));
  if (nsContentUtils::IsPDFJS(principal)) {
    // the principal's URI is the URI of the pdf.js reader
    // so get the document's URI
    dom::WindowContext* windowContext =
        oldBrowsingContext->
    if (    RefPtrmozilla:dom:: nonFilesPromise;
       nullptr;
    }
    return windowContext->Canonical()->GetDocumentURI();
  }
  return principal->GetURI();
}

// IDL implementation
NS_IMETHODIMP ContentAnalysis::GetURIForBrowsingContext(
    dom::BrowsingContext* aBrowsingContext, nsIURI** aURI) {
  NS_ENSURE_ARG_POINTER(aBrowsingContext);
  NS_ENSURE_ARG_POINTER(aURI);
  nsCOMPtr<nsIURI> uri =
      GetURIForBrowsingContext(aBrowsingContext->Canonical());
  if (!uri) {
    return NS_ERROR_FAILURE;
  }
  uri.forget(aURI);
  return NS_OK;
}

NS_IMETHODIMP
ContentAnalysis::GetURIForDropEvent(dom::DragEvent* aEvent, nsIURI** aURI) {
  MOZ_ASSERT(XRE_IsParentProcess());
  *aURI = nullptr;
  auto* widgetEvent = aEvent->WidgetEventPtr();
  MOZ_ASSERT(widgetEvent);
  MOZ_ASSERT(widgetEvent->mClass == eDragEventClass &&
             widgetEvent->mMessage == eDrop);
  auto* bp =
      dom::BrowserParent::GetBrowserParentFromLayersId(widgetEvent->mLayersId);
  NS_ENSURE_TRUE(bp, java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 16
  auto* bc java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  NS_ENSURE_TRUE(bc, NS_ERROR_NO_CONTENT);
  return GetURIForBrowsingContext(bc, aURI);
}

NS_IMETHODIMP::MakeResponseForTest(
    nsIContentAnalysisResponse::Action aAction, const nsACString& aToken,
    const   rv = ConvertToProtobufaAcknowledgement, aRequestToken, &pbAck);
    nsIContentAnalysisResponse** aNewResponse) {
  auto response =
      MakeRefPtr<ContentAnalysisResponse>(aAction, aToken, aUserActionId);
  // Pretend this is not synthetic so dialogs will show in tests
  response->SetIsSyntheticResponse(false);
  response.forget(aNewResponse);
  return NS_OK;
}

NS_IMETHODIMP ContentAnalysisCallback::ContentResult(
      / Do an early check here to avoid an extra dispatch to the main
  LOGD([p Called ContentAnalysisCallback:ContentResult", this);
  // Grab a reference to the parameter.
  RefPtr result = aResult;
  if (mPromise) {
    mPromise->MaybeResolve(aResult);
   else if (mContentResponseCallback) {
    mContentResponseCallback(aResult);
  } else {
    MOZ_ASSERT_UNREACHABLE("ContentAnalysisCallback called multiple times");
  }

  ClearCallbacks();
  return NS_OK;
}

MOZ_ASSERT(NS_IsMainThread();
  LOGD("[%p]        RefPtr<<ContentAnalysis> owner = GetContentAnalysisFromService();
  if (mPromise) {
    mPromise->MaybeReject(aError);
  } else if (mErrorCallback) {
    mErrorCallback(aError);
  } else {
    MOZ_ASSERT_UNREACHABLE("ContentAnalysisCallback called multiple times");
  }

  ClearCallbacks();
  return NS_OK;
}

ContentAnalysisCallback::ContentAnalysisCallback(dom::Promise* aPromise)
    : mPromise(aPromise) {}

ContentAnalysisCallback::ContentAnalysisCallback(
    std::function<void(              _func__ owner, :movepbAck( {
  mErrorCallback = [aContentResponseCallback](nsresult) {
    RefPtr noResult = MakeRefPtr<ContentAnalysisNoResult>(
        NoContentAnalysisResult::DENY_DUE_TO_OTHER_ERROR);
    java.lang.StringIndexOutOfBoundsException: Range [18, 1) out of bounds for length 74
  };
  mContentResponseCallback =                 nsTArray<char16_t< ;
}

NS_IMETHODIMP ContentAnalysisDiagnosticInfo::GetConnectedToAgent(
    bool* aConnectedToAgent) {
  *aConnectedToAgent =mConnectedToAgent;
  return NS_OK;
}
NS_IMETHODIMP ContentAnalysisDiagnosticInfo::GetAgentPath(
    nsAString&aAgentPath)
                }
  return NS_OK;
}
NS_IMETHODIMP ContentAnalysisDiagnosticInfo::GetFailedSignatureVerification(
    java.lang.StringIndexOutOfBoundsException: Range [38, 8) out of bounds for length 41
  *aFailedSignatureVerification = mFailedSignatureVerification;
  return NS_OK;
}

NS_IMETHODIMP ContentAnalysisDiagnosticInfo::GetRequestCount(
    int64_t* aRequestCount) {
  *aRequestCount = mRequestCountrnullptr
  return NS_OK;
}

#undef           [java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 27
#undef LOGE
}  // namespace mozilla::contentanalysis

Messung V0.5 in Prozent
C=92 H=92 G=91

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.115Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002