Bug 1510911 - Part 3: Backout changeset d0997972e4d4 (bug 1493563 - Part 4) for regressing performance
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 29 Nov 2018 10:50:38 -0500
changeset 508548 4f08283a2e3a13c454ab82115b7c6e191ada7bbd
parent 508547 82236b4be4c96f1830f6435164407b31e108bc02
child 508549 e90a86bd84b223121f4ee82756030d354925fe30
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1510911, 1493563
milestone65.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 1510911 - Part 3: Backout changeset d0997972e4d4 (bug 1493563 - Part 4) for regressing performance
dom/base/nsGlobalWindowOuter.cpp
dom/security/nsMixedContentBlocker.cpp
netwerk/base/nsISecurityEventSink.idl
security/manager/ssl/nsSecureBrowserUIImpl.cpp
security/manager/ssl/nsSecureBrowserUIImpl.h
uriloader/base/nsDocLoader.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -5068,18 +5068,17 @@ void nsGlobalWindowOuter::NotifyContentB
     state &= ~aState;
   }
 
   if (state == oldState) {
     // Avoid dispatching repeated notifications when nothing has changed
     return;
   }
 
-  eventSink->OnSecurityChange(aChannel, oldState, state,
-                              doc->GetContentBlockingLog());
+  eventSink->OnSecurityChange(aChannel, state);
 }
 
 // static
 bool nsGlobalWindowOuter::SameLoadingURI(nsIDocument* aDoc,
                                          nsIChannel* aChannel) {
   nsCOMPtr<nsIURI> docURI = aDoc->GetDocumentURI();
   nsCOMPtr<nsILoadInfo> channelLoadInfo = aChannel->GetLoadInfo();
   if (!channelLoadInfo || !docURI) {
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -97,17 +97,16 @@ class nsMixedContentEvent : public Runna
     NS_ASSERTION(
         sameTypeRoot,
         "No document shell root tree item from document shell tree item!");
 
     // now get the document from sameTypeRoot
     nsCOMPtr<nsIDocument> rootDoc = sameTypeRoot->GetDocument();
     NS_ASSERTION(rootDoc,
                  "No root document from document shell root tree item.");
-    ContentBlockingLog* contentBlockingLog = rootDoc->GetContentBlockingLog();
 
     // Get eventSink and the current security state from the docShell
     nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
     NS_ASSERTION(eventSink, "No eventSink from docShell.");
     nsCOMPtr<nsIDocShell> rootShell = do_GetInterface(sameTypeRoot);
     NS_ASSERTION(rootShell,
                  "No root docshell from document shell root tree item.");
     uint32_t state = nsIWebProgressListener::STATE_IS_BROKEN;
@@ -141,28 +140,26 @@ class nsMixedContentEvent : public Runna
 
           // If mixed display content is loaded, make sure to include that in
           // the state.
           if (rootDoc->GetHasMixedDisplayContentLoaded()) {
             state |= nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
           }
 
           eventSink->OnSecurityChange(
-              mContext, state,
+              mContext,
               (state |
-               nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT),
-              contentBlockingLog);
+               nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
         } else {
           // root not secure, mixed active content loaded in an https subframe
           if (NS_SUCCEEDED(stateRV)) {
             eventSink->OnSecurityChange(
-                mContext, state,
+                mContext,
                 (state |
-                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT),
-                contentBlockingLog);
+                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
           }
         }
       }
 
     } else if (mType == eMixedDisplay) {
       // See if the pref will change here. If it will, only then do we need to
       // call OnSecurityChange() to update the UI.
       if (rootDoc->GetHasMixedDisplayContentLoaded()) {
@@ -183,28 +180,26 @@ class nsMixedContentEvent : public Runna
 
           // If mixed active content is loaded, make sure to include that in the
           // state.
           if (rootDoc->GetHasMixedActiveContentLoaded()) {
             state |= nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT;
           }
 
           eventSink->OnSecurityChange(
-              mContext, state,
+              mContext,
               (state |
-               nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT),
-              contentBlockingLog);
+               nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
         } else {
           // root not secure, mixed display content loaded in an https subframe
           if (NS_SUCCEEDED(stateRV)) {
             eventSink->OnSecurityChange(
-                mContext, state,
+                mContext,
                 (state |
-                 nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT),
-                contentBlockingLog);
+                 nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
           }
         }
       }
     }
 
     return NS_OK;
   }
 
@@ -895,17 +890,16 @@ nsresult nsMixedContentBlocker::ShouldLo
       *aDecision = nsIContentPolicy::ACCEPT;
       return NS_OK;
     }
   }
 
   // Get the root document from the sameTypeRoot
   nsCOMPtr<nsIDocument> rootDoc = sameTypeRoot->GetDocument();
   NS_ASSERTION(rootDoc, "No root document from document shell root tree item.");
-  ContentBlockingLog* contentBlockingLog = rootDoc->GetContentBlockingLog();
 
   // Get eventSink and the current security state from the docShell
   nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
   NS_ASSERTION(eventSink, "No eventSink from docShell.");
   nsCOMPtr<nsIDocShell> rootShell = do_GetInterface(sameTypeRoot);
   NS_ASSERTION(rootShell,
                "No root docshell from document shell root tree item.");
   uint32_t state = nsIWebProgressListener::STATE_IS_BROKEN;
@@ -986,43 +980,40 @@ nsresult nsMixedContentBlocker::ShouldLo
 
         // If mixed active content is loaded, make sure to include that in the
         // state.
         if (rootDoc->GetHasMixedActiveContentLoaded()) {
           state |= nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT;
         }
 
         eventSink->OnSecurityChange(
-            aRequestingContext, state,
+            aRequestingContext,
             (state |
-             nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT),
-            contentBlockingLog);
+             nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
       } else {
         // User has overriden the pref and the root is not https;
         // mixed display content was allowed on an https subframe.
         if (NS_SUCCEEDED(stateRV)) {
           eventSink->OnSecurityChange(
-              aRequestingContext, state,
+              aRequestingContext,
               (state |
-               nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT),
-              contentBlockingLog);
+               nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
         }
       }
     } else {
       *aDecision = nsIContentPolicy::REJECT_REQUEST;
       LogMixedContentMessage(classification, aContentLocation, rootDoc,
                              eBlocked);
       if (!rootDoc->GetHasMixedDisplayContentBlocked() &&
           NS_SUCCEEDED(stateRV)) {
         rootDoc->SetHasMixedDisplayContentBlocked(true);
         eventSink->OnSecurityChange(
-            aRequestingContext, state,
+            aRequestingContext,
             (state |
-             nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT),
-            contentBlockingLog);
+             nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT));
       }
     }
     return NS_OK;
 
   } else if (sBlockMixedScript && classification == eMixedScript) {
     // If the content is active content, and the pref says active content should
     // be blocked, block it unless the user has choosen to override the pref
     if (allowMixedContent) {
@@ -1044,30 +1035,29 @@ nsresult nsMixedContentBlocker::ShouldLo
 
         // If mixed display content is loaded, make sure to include that in the
         // state.
         if (rootDoc->GetHasMixedDisplayContentLoaded()) {
           state |= nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
         }
 
         eventSink->OnSecurityChange(
-            aRequestingContext, state,
-            (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT),
-            contentBlockingLog);
+            aRequestingContext,
+            (state |
+             nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
 
         return NS_OK;
       } else {
         // User has already overriden the pref and the root is not https;
         // mixed active content was allowed on an https subframe.
         if (NS_SUCCEEDED(stateRV)) {
           eventSink->OnSecurityChange(
-              aRequestingContext, state,
+              aRequestingContext,
               (state |
-               nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT),
-              contentBlockingLog);
+               nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
         }
         return NS_OK;
       }
     } else {
       // User has not overriden the pref by Disabling protection. Reject the
       // request and update the security state.
       *aDecision = nsIContentPolicy::REJECT_REQUEST;
       LogMixedContentMessage(classification, aContentLocation, rootDoc,
@@ -1078,20 +1068,19 @@ nsresult nsMixedContentBlocker::ShouldLo
         return NS_OK;
       }
       rootDoc->SetHasMixedActiveContentBlocked(true);
 
       // The user has not overriden the pref, so make sure they still have an
       // option by calling eventSink which will invoke the doorhanger
       if (NS_SUCCEEDED(stateRV)) {
         eventSink->OnSecurityChange(
-            aRequestingContext, state,
+            aRequestingContext,
             (state |
-             nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT),
-            contentBlockingLog);
+             nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT));
       }
       return NS_OK;
     }
   } else {
     // The content is not blocked by the mixed content prefs.
 
     // Log a message that we are loading mixed content.
     LogMixedContentMessage(classification, aContentLocation, rootDoc,
--- a/netwerk/base/nsISecurityEventSink.idl
+++ b/netwerk/base/nsISecurityEventSink.idl
@@ -1,39 +1,26 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #include "nsISupports.idl"
-
-%{ C++
-namespace mozilla {
-namespace dom {
-class ContentBlockingLog;
-}
-}
-%}
-
-[ptr] native ContentBlockingLog(mozilla::dom::ContentBlockingLog);
+interface nsIURI;
 
 [builtinclass, uuid(a71aee68-dd38-4736-bd79-035fea1a1ec6)]
 interface nsISecurityEventSink : nsISupports
 {
 
     /**
       * Fired when a security change occurs due to page transitions,
       * or end document load. This interface should be called by
       * a security package (eg Netscape Personal Security Manager)
       * to notify nsIWebProgressListeners that security state has
       * changed. State flags are in nsIWebProgressListener.idl
-      * The old state flags before the change must also be passed in.
-      * cbLog represents the log of the content blocking actions on
-      * the page so far.
       */
 
-    void onSecurityChange(in nsISupports i_Context, in unsigned long oldState,
-                          in unsigned long state, in ContentBlockingLog cbLog);
+    void onSecurityChange(in nsISupports i_Context, in unsigned long state);
 };
 
 
 
 
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -16,17 +16,17 @@
 #include "nsISecurityEventSink.h"
 #include "nsITransportSecurityInfo.h"
 #include "nsIWebProgress.h"
 
 using namespace mozilla;
 
 LazyLogModule gSecureBrowserUILog("nsSecureBrowserUI");
 
-nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mOldState(0), mState(0) {
+nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mState(0) {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl, nsISecureBrowserUI,
                   nsIWebProgressListener, nsISupportsWeakReference)
 
 NS_IMETHODIMP
 nsSecureBrowserUIImpl::Init(nsIDocShell* aDocShell) {
@@ -102,18 +102,16 @@ void nsSecureBrowserUIImpl::CheckForBloc
         sameTypeRoot,
         "No document shell root tree item from document shell tree item!");
     docShell = do_QueryInterface(sameTypeRoot);
     if (!docShell) {
       return;
     }
   }
 
-  mOldState = mState;
-
   // Has mixed content been loaded or blocked in nsMixedContentBlocker?
   // This only applies to secure documents even if they're affected by mixed
   // content blocking in which case the STATE_IS_BROKEN bit would be set rather
   // than STATE_IS_SECURE.
   if (((mState & STATE_IS_SECURE) != 0) || ((mState & STATE_IS_BROKEN) != 0)) {
     if (docShell->GetHasMixedActiveContentLoaded()) {
       mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_ACTIVE_CONTENT;
       mState &= ~STATE_IS_SECURE;
@@ -348,17 +346,16 @@ nsSecureBrowserUIImpl::OnLocationChange(
   }
 
   // If this is a same-document location change, we don't need to update our
   // state or notify anyone.
   if (aFlags & LOCATION_CHANGE_SAME_DOCUMENT) {
     return NS_OK;
   }
 
-  mOldState = 0;
   mState = 0;
   mTopLevelSecurityInfo = nullptr;
 
   if (aFlags & LOCATION_CHANGE_ERROR_PAGE) {
     mState = STATE_IS_INSECURE;
     mTopLevelSecurityInfo = nullptr;
   } else {
     // NB: aRequest may be null. It may also not be QI-able to nsIChannel.
@@ -375,31 +372,22 @@ nsSecureBrowserUIImpl::OnLocationChange(
                 ("  Failed to update security info. "
                  "Setting everything to 'not secure' to be safe."));
         mState = STATE_IS_INSECURE;
         mTopLevelSecurityInfo = nullptr;
       }
     }
   }
 
-  mozilla::dom::ContentBlockingLog* contentBlockingLog = nullptr;
   nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShell);
-  if (docShell) {
-    nsIDocument* doc = docShell->GetDocument();
-    if (doc) {
-      contentBlockingLog = doc->GetContentBlockingLog();
-    }
-  }
-
   nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
   if (eventSink) {
     MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug,
             ("  calling OnSecurityChange %p %x", aRequest, mState));
-    Unused << eventSink->OnSecurityChange(aRequest, mOldState, mState,
-                                          contentBlockingLog);
+    Unused << eventSink->OnSecurityChange(aRequest, mState);
   } else {
     MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug,
             ("  no docShell or couldn't QI it to nsISecurityEventSink?"));
   }
 
   return NS_OK;
 }
 
--- a/security/manager/ssl/nsSecureBrowserUIImpl.h
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.h
@@ -29,23 +29,21 @@ class nsSecureBrowserUIImpl : public nsI
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSISECUREBROWSERUI
 
  protected:
   virtual ~nsSecureBrowserUIImpl(){};
 
-  // Do mixed content and tracking protection checks. May update mState and
-  // mOldState.
+  // Do mixed content and tracking protection checks. May update mState.
   void CheckForBlockedContent();
   // Given some information about a request from an OnLocationChange event,
-  // update mState, mOldState and mTopLevelSecurityInfo.
+  // update mState and mTopLevelSecurityInfo.
   nsresult UpdateStateAndSecurityInfo(nsIChannel* channel, nsIURI* uri);
 
-  uint32_t mOldState;
   uint32_t mState;
   nsWeakPtr mDocShell;
   nsWeakPtr mWebProgress;
   nsCOMPtr<nsITransportSecurityInfo> mTopLevelSecurityInfo;
 };
 
 #endif  // nsSecureBrowserUIImpl_h
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -35,17 +35,16 @@
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsILoadURIDelegate.h"
 #include "nsIBrowserDOMWindow.h"
 
 using mozilla::DebugOnly;
 using mozilla::LogLevel;
-using mozilla::dom::ContentBlockingLog;
 
 //
 // Log module for nsIDocumentLoader logging...
 //
 // To enable logging (see mozilla/Logging.h for full details):
 //
 //    set MOZ_LOG=DocLoader:5
 //    set MOZ_LOG_FILE=debug.log
@@ -1389,32 +1388,31 @@ NS_IMETHODIMP nsDocLoader::AsyncOnChanne
   cb->OnRedirectVerifyCallback(NS_OK);
   return NS_OK;
 }
 
 /*
  * Implementation of nsISecurityEventSink method...
  */
 
-NS_IMETHODIMP nsDocLoader::OnSecurityChange(
-    nsISupports* aContext, uint32_t aOldState, uint32_t aState,
-    ContentBlockingLog* aContentBlockingLog) {
+NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports* aContext,
+                                            uint32_t aState) {
   //
   // Fire progress notifications out to any registered nsIWebProgressListeners.
   //
 
   nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext);
   nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(this);
 
   NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_SECURITY,
                    listener->OnSecurityChange(webProgress, request, aState););
 
   // Pass the notification up to the parent...
   if (mParent) {
-    mParent->OnSecurityChange(aContext, aOldState, aState, aContentBlockingLog);
+    mParent->OnSecurityChange(aContext, aState);
   }
   return NS_OK;
 }
 
 /*
  * Implementation of nsISupportsPriority methods...
  *
  * The priority of the DocLoader _is_ the priority of its LoadGroup.