Commit c40827d1 authored by Nika Layzell's avatar Nika Layzell Committed by Pier Angelo Vendrame
Browse files

Bug 2038678 - Clean up unnecessary object traversal for remoteType, a=dmeehan

parent ca7d9cf2
Loading
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -87,12 +87,9 @@ export class AboutLoginsParent extends JSWindowActorParent {
    // Only respond to messages sent from a privlegedabout process. Ideally
    // we would also check the contentPrincipal.originNoSuffix but this
    // check has been removed due to bug 1576722.
    if (
      this.browsingContext.embedderElement.remoteType !=
      EXPECTED_ABOUTLOGINS_REMOTE_TYPE
    ) {
    if (this.manager.remoteType != EXPECTED_ABOUTLOGINS_REMOTE_TYPE) {
      throw new Error(
        `AboutLoginsParent: Received ${message.name} message the remote type didn't match expectations: ${this.browsingContext.embedderElement.remoteType} == ${EXPECTED_ABOUTLOGINS_REMOTE_TYPE}`
        `AboutLoginsParent: Received ${message.name} message the remote type didn't match expectations: ${this.manager.remoteType} == ${EXPECTED_ABOUTLOGINS_REMOTE_TYPE}`
      );
    }

+2 −3
Original line number Diff line number Diff line
@@ -62,9 +62,8 @@ export class MigrationWizardParent extends JSWindowActorParent {
    // make sure that any messages from content are coming from the privileged
    // about content process type.
    if (
      !this.browsingContext.currentWindowGlobal.isInProcess &&
      this.browsingContext.currentRemoteType !=
        E10SUtils.PRIVILEGEDABOUT_REMOTE_TYPE
      !this.manager.isInProcess &&
      this.manager.remoteType != E10SUtils.PRIVILEGEDABOUT_REMOTE_TYPE
    ) {
      throw new Error(
        "MigrationWizardParent: received message from the wrong content process type."
+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ interface WindowGlobalParent : WindowContext {

  readonly attribute long osPid;

  // The remote type of `this.domProcess`.
  readonly attribute UTF8String? remoteType;

  // A WindowGlobalParent is the root in its process if it has no parent, or its
  // embedder is in a different process.
  readonly attribute boolean isProcessRoot;
+4 −0
Original line number Diff line number Diff line
@@ -591,6 +591,10 @@ const nsACString& WindowGlobalParent::GetRemoteType() {
  return NOT_REMOTE_TYPE;
}

void WindowGlobalParent::GetRemoteType(nsACString& aRemoteType) {
  aRemoteType = GetRemoteType();
}

void WindowGlobalParent::NotifyContentBlockingEvent(
    uint32_t aEvent, nsIRequest* aRequest, bool aBlocked,
    const nsACString& aTrackingOrigin,
+1 −0
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ class WindowGlobalParent final : public WindowContext,
  nsITransportSecurityInfo* GetSecurityInfo() { return mSecurityInfo; }

  const nsACString& GetRemoteType() override;
  void GetRemoteType(nsACString& aRemoteType);

  void NotifySessionStoreUpdatesComplete(Element* aEmbedder);

Loading