Commit 22a65a23 authored by Nika Layzell's avatar Nika Layzell
Browse files

Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi

parent 0877db2b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
  // startup cache.
  if (XRE_IsContentProcess() && path.EqualsLiteral("home")) {
    auto& remoteType = dom::ContentChild::GetSingleton()->GetRemoteType();
    if (remoteType.EqualsLiteral(PRIVILEGEDABOUT_REMOTE_TYPE)) {
    if (remoteType == PRIVILEGEDABOUT_REMOTE_TYPE) {
      nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
          do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
      NS_ENSURE_SUCCESS(rv, rv);
+1 −1
Original line number Diff line number Diff line
@@ -938,7 +938,7 @@ nsresult nsScriptSecurityManager::CheckLoadURIFlags(
        }

        auto& remoteType = dom::ContentChild::GetSingleton()->GetRemoteType();
        if (remoteType.EqualsLiteral(PRIVILEGEDABOUT_REMOTE_TYPE)) {
        if (remoteType == PRIVILEGEDABOUT_REMOTE_TYPE) {
          return NS_OK;
        }
      }
+2 −3
Original line number Diff line number Diff line
@@ -1047,9 +1047,8 @@ bool BrowsingContext::CrossOriginIsolated() {
             nsILoadInfo::
                 OPENER_POLICY_SAME_ORIGIN_EMBEDDER_POLICY_REQUIRE_CORP &&
         XRE_IsContentProcess() &&
         StringBeginsWith(
             ContentChild::GetSingleton()->GetRemoteType(),
             NS_LITERAL_STRING_FROM_CSTRING(WITH_COOP_COEP_REMOTE_TYPE_PREFIX));
         StringBeginsWith(ContentChild::GetSingleton()->GetRemoteType(),
                          WITH_COOP_COEP_REMOTE_TYPE_PREFIX);
}

BrowsingContext::~BrowsingContext() {
+3 −3
Original line number Diff line number Diff line
@@ -94,11 +94,11 @@ ContentParent* CanonicalBrowsingContext::GetContentParent() const {
  return cpm->GetContentProcessById(ContentParentId(mProcessId));
}

void CanonicalBrowsingContext::GetCurrentRemoteType(nsAString& aRemoteType,
void CanonicalBrowsingContext::GetCurrentRemoteType(nsACString& aRemoteType,
                                                    ErrorResult& aRv) const {
  // If we're in the parent process, dump out the void string.
  if (mProcessId == 0) {
    aRemoteType.Assign(VoidString());
    aRemoteType.Assign(VoidCString());
    return;
  }

@@ -822,7 +822,7 @@ CanonicalBrowsingContext::PendingRemotenessChange::~PendingRemotenessChange() {
}

RefPtr<CanonicalBrowsingContext::RemotenessPromise>
CanonicalBrowsingContext::ChangeRemoteness(const nsAString& aRemoteType,
CanonicalBrowsingContext::ChangeRemoteness(const nsACString& aRemoteType,
                                           uint64_t aPendingSwitchId,
                                           bool aReplaceBrowsingContext,
                                           uint64_t aSpecificGroupId) {
+3 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ class CanonicalBrowsingContext final : public BrowsingContext {
  uint64_t EmbedderProcessId() const { return mEmbedderProcessId; }
  ContentParent* GetContentParent() const;

  void GetCurrentRemoteType(nsAString& aRemoteType, ErrorResult& aRv) const;
  void GetCurrentRemoteType(nsACString& aRemoteType, ErrorResult& aRv) const;

  void SetOwnerProcessId(uint64_t aProcessId);

@@ -150,10 +150,10 @@ class CanonicalBrowsingContext final : public BrowsingContext {
  // Internal method to change which process a BrowsingContext is being loaded
  // in. The returned promise will resolve when the process switch is completed.
  //
  // A VoidString() aRemoteType argument will perform a process switch into the
  // A VoidCString() aRemoteType argument will perform a process switch into the
  // parent process, and the method will resolve with a null BrowserParent.
  using RemotenessPromise = MozPromise<RefPtr<BrowserParent>, nsresult, false>;
  RefPtr<RemotenessPromise> ChangeRemoteness(const nsAString& aRemoteType,
  RefPtr<RemotenessPromise> ChangeRemoteness(const nsACString& aRemoteType,
                                             uint64_t aPendingSwitchId,
                                             bool aReplaceBrowsingContext,
                                             uint64_t aSpecificGroupId);
Loading