Bug 1624761 - Remove OverrideStatus from DocumentLoadListener. r=mattwoodrow
authorDan Glastonbury <dan.glastonbury@gmail.com>
Wed, 25 Mar 2020 01:12:37 +0000
changeset 520326 8e62447674010cc192739c4c5f8d4fc5537274ae
parent 520325 58d155b0b54abe3fc6ce31261853b37bd2dcb538
child 520327 64e1f15e54321ab0fd66eae40055bda59ccab4ec
push id37247
push userbtara@mozilla.com
push dateWed, 25 Mar 2020 09:34:57 +0000
treeherdermozilla-central@2abd352490a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1624761
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1624761 - Remove OverrideStatus from DocumentLoadListener. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D68132
netwerk/ipc/DocumentChannelParent.cpp
netwerk/ipc/DocumentChannelParent.h
netwerk/ipc/DocumentLoadListener.cpp
netwerk/ipc/DocumentLoadListener.h
netwerk/ipc/NeckoParent.cpp
--- a/netwerk/ipc/DocumentChannelParent.cpp
+++ b/netwerk/ipc/DocumentChannelParent.cpp
@@ -14,24 +14,22 @@ extern mozilla::LazyLogModule gDocumentC
 #define LOG(fmt) MOZ_LOG(gDocumentChannelLog, mozilla::LogLevel::Verbose, fmt)
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace net {
 
 DocumentChannelParent::DocumentChannelParent(CanonicalBrowsingContext* aContext,
-                                             nsILoadContext* aLoadContext,
-                                             PBOverrideStatus aOverrideStatus) {
+                                             nsILoadContext* aLoadContext) {
   LOG(("DocumentChannelParent ctor [this=%p]", this));
   // Sometime we can get this called without a BrowsingContext, so that we have
   // an actor to call SendFailedAsyncOpen on.
   if (aContext) {
-    mParent =
-        new DocumentLoadListener(aContext, aLoadContext, aOverrideStatus, this);
+    mParent = new DocumentLoadListener(aContext, aLoadContext, this);
   }
 }
 
 DocumentChannelParent::~DocumentChannelParent() {
   LOG(("DocumentChannelParent dtor [this=%p]", this));
 }
 
 bool DocumentChannelParent::Init(const DocumentChannelCreationArgs& aArgs) {
--- a/netwerk/ipc/DocumentChannelParent.h
+++ b/netwerk/ipc/DocumentChannelParent.h
@@ -22,18 +22,17 @@ namespace net {
  * process docshell.
  */
 class DocumentChannelParent final : public ADocumentChannelBridge,
                                     public PDocumentChannelParent {
  public:
   NS_INLINE_DECL_REFCOUNTING(DocumentChannelParent, override);
 
   explicit DocumentChannelParent(dom::CanonicalBrowsingContext* aContext,
-                                 nsILoadContext* aLoadContext,
-                                 PBOverrideStatus aOverrideStatus);
+                                 nsILoadContext* aLoadContext);
 
   bool Init(const DocumentChannelCreationArgs& aArgs);
 
   // PDocumentChannelParent
   bool RecvCancel(const nsresult& aStatus) {
     if (mParent) {
       mParent->Cancel(aStatus);
     }
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -233,18 +233,18 @@ NS_INTERFACE_MAP_BEGIN(DocumentLoadListe
   NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
   NS_INTERFACE_MAP_ENTRY(nsIProcessSwitchRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIMultiPartChannelListener)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(DocumentLoadListener)
 NS_INTERFACE_MAP_END
 
 DocumentLoadListener::DocumentLoadListener(
     CanonicalBrowsingContext* aBrowsingContext, nsILoadContext* aLoadContext,
-    PBOverrideStatus aOverrideStatus, ADocumentChannelBridge* aBridge)
-    : mLoadContext(aLoadContext), mPBOverride(aOverrideStatus) {
+    ADocumentChannelBridge* aBridge)
+    : mLoadContext(aLoadContext) {
   LOG(("DocumentLoadListener ctor [this=%p]", this));
   mParentChannelListener = new ParentChannelListener(
       this, aBrowsingContext, aLoadContext->UsePrivateBrowsing());
   mDocumentChannelBridge = aBridge;
 }
 
 DocumentLoadListener::~DocumentLoadListener() {
   LOG(("DocumentLoadListener dtor [this=%p]", this));
@@ -408,22 +408,16 @@ bool DocumentLoadListener::Open(
 
     if (contentBlockingAllowListPrincipal &&
         contentBlockingAllowListPrincipal->GetIsContentPrincipal()) {
       httpBaseChannel->SetContentBlockingAllowListPrincipal(
           contentBlockingAllowListPrincipal);
     }
   }
 
-  nsCOMPtr<nsIPrivateBrowsingChannel> privateChannel =
-      do_QueryInterface(mChannel);
-  if (mPBOverride != kPBOverride_Unset) {
-    privateChannel->SetPrivate(mPBOverride == kPBOverride_Private);
-  }
-
   nsCOMPtr<nsIIdentChannel> identChannel = do_QueryInterface(mChannel);
   if (identChannel) {
     Unused << identChannel->SetChannelId(aChannelId);
   }
 
   RefPtr<nsHttpChannel> httpChannelImpl = do_QueryObject(mChannel);
   if (httpChannelImpl) {
     httpChannelImpl->SetWarningReporter(this);
--- a/netwerk/ipc/DocumentLoadListener.h
+++ b/netwerk/ipc/DocumentLoadListener.h
@@ -60,17 +60,16 @@ class DocumentLoadListener : public nsII
                              public nsIParentChannel,
                              public nsIChannelEventSink,
                              public HttpChannelSecurityWarningReporter,
                              public nsIProcessSwitchRequestor,
                              public nsIMultiPartChannelListener {
  public:
   explicit DocumentLoadListener(dom::CanonicalBrowsingContext* aBrowsingContext,
                                 nsILoadContext* aLoadContext,
-                                PBOverrideStatus aOverrideStatus,
                                 ADocumentChannelBridge* aBridge);
 
   // Creates the channel, and then calls AsyncOpen on it.
   bool Open(nsDocShellLoadState* aLoadState, LoadInfo* aLoadInfo,
             nsLoadFlags aLoadFlags, uint32_t aCacheKey,
             const uint64_t& aChannelId, const TimeStamp& aAsyncOpenTime,
             nsDOMNavigationTiming* aTiming, Maybe<dom::ClientInfo>&& aInfo,
             uint64_t aOuterWindowId, nsresult* aRv);
@@ -296,18 +295,16 @@ class DocumentLoadListener : public nsII
   // The bridge to the nsIChannel in the originating docshell.
   // This reference forms a cycle with the bridge, and we expect
   // the bridge to call DisonnectDocumentChannelBridge when it
   // shuts down to break this.
   RefPtr<ADocumentChannelBridge> mDocumentChannelBridge;
 
   nsCOMPtr<nsILoadContext> mLoadContext;
 
-  PBOverrideStatus mPBOverride;
-
   // The original URI of the current channel. If there are redirects,
   // then the value on the channel gets overwritten with the original
   // URI of the first channel in the redirect chain, so we cache the
   // value we need here.
   nsCOMPtr<nsIURI> mChannelCreationURI;
 
   // The original navigation timing information containing various timestamps
   // such as when the original load started.
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -423,20 +423,18 @@ NeckoParent::AllocPDocumentChannelParent
       GetRequestingPrincipal(Some(args.loadInfo()));
 
   nsCOMPtr<nsILoadContext> loadContext;
   const char* error = CreateChannelLoadContext(
       aBrowser, Manager(), aSerialized, requestingPrincipal, loadContext);
   if (error) {
     return nullptr;
   }
-  PBOverrideStatus overrideStatus =
-      PBOverrideStatusFromLoadContext(aSerialized);
   RefPtr<DocumentChannelParent> p =
-      new DocumentChannelParent(context, loadContext, overrideStatus);
+      new DocumentChannelParent(context, loadContext);
   return p.forget();
 }
 
 mozilla::ipc::IPCResult NeckoParent::RecvPDocumentChannelConstructor(
     PDocumentChannelParent* aActor, PBrowserParent* aBrowser,
     const MaybeDiscarded<BrowsingContext>& aContext,
     const SerializedLoadContext& aSerialized,
     const DocumentChannelCreationArgs& aArgs) {