Backed out changeset d801dfa24d7d (bug 1517136) for build bustages at /security/manager/ssl/nsSecureBrowserUIImpl.cpp on a CLOSED TREE
authorGurzau Raul <rgurzau@mozilla.com>
Mon, 07 Jan 2019 23:42:15 +0200
changeset 509939 cb27ce235427c56a3bf3bfbcee25249d5fae5939
parent 509938 9b7f30c265e983ee590ede12c84ab1b78dda5cc3
child 509940 5f427c2fdff5b3e4ff2e791c009f2b77e9a3d659
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1517136
milestone66.0a1
backs outd801dfa24d7d11e7dca3934ba52a3900c07af660
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
Backed out changeset d801dfa24d7d (bug 1517136) for build bustages at /security/manager/ssl/nsSecureBrowserUIImpl.cpp on a CLOSED TREE
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
security/manager/ssl/nsSecureBrowserUIImpl.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1374,16 +1374,69 @@ nsDocShell::GetHasMixedDisplayContentBlo
     bool* aHasMixedDisplayContentBlocked) {
   RefPtr<Document> doc(GetDocument());
   *aHasMixedDisplayContentBlocked =
       doc && doc->GetHasMixedDisplayContentBlocked();
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDocShell::GetHasTrackingContentBlocked(bool* aHasTrackingContentBlocked) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasTrackingContentBlocked = doc && doc->GetHasTrackingContentBlocked();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasTrackingContentLoaded(bool* aHasTrackingContentLoaded) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasTrackingContentLoaded = doc && doc->GetHasTrackingContentLoaded();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasCookiesBlockedByPermission(
+    bool* aHasCookiesBlockedByPermission) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasCookiesBlockedByPermission =
+      doc && doc->GetHasCookiesBlockedByPermission();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasCookiesBlockedDueToTrackers(
+    bool* aHasCookiesBlockedDueToTrackers) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasCookiesBlockedDueToTrackers = doc && doc->GetHasTrackingCookiesBlocked();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasAllCookiesBeenBlocked(bool* aHasAllCookiesBeenBlocked) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasAllCookiesBeenBlocked = doc && doc->GetHasAllCookiesBlocked();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasForeignCookiesBeenBlocked(
+    bool* aHasForeignCookiesBeenBlocked) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasForeignCookiesBeenBlocked = doc && doc->GetHasForeignCookiesBlocked();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasCookiesLoaded(bool* aHasCookiesLoaded) {
+  RefPtr<Document> doc(GetDocument());
+  *aHasCookiesLoaded = doc && doc->GetHasCookiesLoaded();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsDocShell::GetAllowPlugins(bool* aAllowPlugins) {
   NS_ENSURE_ARG_POINTER(aAllowPlugins);
 
   *aAllowPlugins = mAllowPlugins;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -494,16 +494,59 @@ interface nsIDocShell : nsIDocShellTreeI
 
    /**
    * This attribute determines whether a document has Mixed Display Content
    * that has been blocked from loading. Similar behavior to
    * hasMixedActiveContentBlocked.
    */
   [infallible] readonly attribute boolean hasMixedDisplayContentBlocked;
 
+   /**
+   * This attribute determines whether a document has Tracking Content
+   * that has been blocked from loading.
+   */
+   [infallible] readonly attribute boolean hasTrackingContentBlocked;
+
+   /**
+   * This attribute determines whether Tracking Content is loaded on the
+   * document. When it is true, tracking content was not blocked and has
+   * loaded (or is about to load) on the page.
+   */
+  [infallible] readonly attribute boolean hasTrackingContentLoaded;
+
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * blocked due to a site permission being denied.
+   */
+   [infallible] readonly attribute boolean hasCookiesBlockedByPermission;
+
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * blocked due to a the request being made by a tracker.
+   */
+   [infallible] readonly attribute boolean hasCookiesBlockedDueToTrackers;
+
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * blocked due to cookie behavior settings blocking all cookies.
+   */
+   [infallible] readonly attribute boolean hasAllCookiesBeenBlocked;
+
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * blocked due to cookie behavior settings blocking all third-party cookies.
+   */
+   [infallible] readonly attribute boolean hasForeignCookiesBeenBlocked;
+
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * attempts ever whether they've been allowed or blocked.
+   */
+   [infallible] readonly attribute boolean hasCookiesLoaded;
+
   /**
    * Disconnects this docshell's editor from its window, and stores the
    * editor data in the open document's session history entry.  This
    * should be called only during page transitions.
    */
   [noscript, notxpcom] void DetachEditorFromWindow();
 
   /**
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -102,72 +102,66 @@ void nsSecureBrowserUIImpl::CheckForBloc
         sameTypeRoot,
         "No document shell root tree item from document shell tree item!");
     docShell = do_QueryInterface(sameTypeRoot);
     if (!docShell) {
       return;
     }
   }
 
-  RefPtr<Document> doc = docShell->GetDocument();
-  if (!doc) {
-    // If the docshell has no document, then there is no need to update mState.
-    return;
-  }
-
   // 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 (doc->GetHasMixedActiveContentLoaded()) {
+    if (docShell->GetHasMixedActiveContentLoaded()) {
       mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_ACTIVE_CONTENT;
       mState &= ~STATE_IS_SECURE;
     }
 
-    if (doc->GetHasMixedDisplayContentLoaded()) {
+    if (docShell->GetHasMixedDisplayContentLoaded()) {
       mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_DISPLAY_CONTENT;
       mState &= ~STATE_IS_SECURE;
     }
 
-    if (doc->GetHasMixedActiveContentBlocked()) {
+    if (docShell->GetHasMixedActiveContentBlocked()) {
       mState |= STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
     }
 
-    if (doc->GetHasMixedDisplayContentBlocked()) {
+    if (docShell->GetHasMixedDisplayContentBlocked()) {
       mState |= STATE_BLOCKED_MIXED_DISPLAY_CONTENT;
     }
   }
 
   // Has tracking content been blocked or loaded?
-  if (doc->GetHasTrackingContentBlocked()) {
+  if (docShell->GetHasTrackingContentBlocked()) {
     mState |= STATE_BLOCKED_TRACKING_CONTENT;
   }
 
-  if (doc->GetHasTrackingContentLoaded()) {
+  if (docShell->GetHasTrackingContentLoaded()) {
     mState |= STATE_LOADED_TRACKING_CONTENT;
   }
 
-  if (doc->GetHasCookiesBlockedByPermission()) {
+  if (docShell->GetHasCookiesBlockedByPermission()) {
     mState |= STATE_COOKIES_BLOCKED_BY_PERMISSION;
   }
 
-  if (doc->GetHasTrackingCookiesBlocked()) {
+  if (docShell->GetHasCookiesBlockedDueToTrackers()) {
     mState |= STATE_COOKIES_BLOCKED_TRACKER;
   }
 
-  if (doc->GetHasForeignCookiesBlocked()) {
+  if (docShell->GetHasForeignCookiesBeenBlocked()) {
     mState |= STATE_COOKIES_BLOCKED_FOREIGN;
   }
 
-  if (doc->GetHasAllCookiesBlocked()) {
+  if (docShell->GetHasAllCookiesBeenBlocked()) {
     mState |= STATE_COOKIES_BLOCKED_ALL;
   }
 
-  if (doc->GetHasCookiesLoaded()) {
+  if (docShell->GetHasCookiesLoaded()) {
     mState |= STATE_COOKIES_LOADED;
   }
 }
 
 // Helper function to determine if the given URI can be considered secure.
 // Essentially, only "https" URIs can be considered secure. However, the URI we
 // have may be e.g. view-source:https://example.com or
 // wyciwyg://https://example.com, in which case we have to evaluate the