Back out ee27d1d8b302 (bug 836951) for depending on a patch that's being backed out
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 26 Mar 2013 20:18:30 -0700
changeset 136737 8136a81da0378b3580379780aae07e4b20a2e672
parent 136736 446b90989fdd8cfdbbf64c86d52b3bcd8de0b7c8
child 136738 c3ed1c7b9aeb26b3be42eb1507b97f483a0b7ad0
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs836951
milestone22.0a1
backs outee27d1d8b302d4ce67509f98f383d984708090dc
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
Back out ee27d1d8b302 (bug 836951) for depending on a patch that's being backed out CLOSED TREE
docshell/base/nsDocShell.cpp
dom/ipc/TabParent.cpp
netwerk/base/public/nsISecureBrowserUI.idl
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
security/manager/boot/src/nsSecureBrowserUIImpl.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2503,17 +2503,16 @@ nsDocShell::GetSecurityUI(nsISecureBrows
     NS_IF_ADDREF(*aSecurityUI = mSecurityUI);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetSecurityUI(nsISecureBrowserUI *aSecurityUI)
 {
     mSecurityUI = aSecurityUI;
-    mSecurityUI->SetDocShell(this);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetUseErrorPages(bool *aUseErrorPages)
 {
     *aUseErrorPages = mUseErrorPages;
     return NS_OK;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -25,17 +25,16 @@
 #include "nsContentPermissionHelper.h"
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsEventDispatcher.h"
 #include "nsEventStateManager.h"
 #include "nsFocusManager.h"
 #include "nsFrameLoader.h"
 #include "nsIContent.h"
-#include "nsIDocShell.h"
 #include "nsIDOMApplicationRegistry.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMHTMLFrameElement.h"
 #include "nsIDOMWindow.h"
 #include "nsIDialogCreator.h"
 #include "nsIPromptFactory.h"
@@ -498,24 +497,16 @@ TabParent::GetState(uint32_t *aState)
 {
   NS_ENSURE_ARG(aState);
   NS_WARNING("SecurityState not valid here");
   *aState = 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TabParent::SetDocShell(nsIDocShell *aDocShell)
-{
-  NS_ENSURE_ARG(aDocShell);
-  NS_WARNING("No mDocShell member in TabParent so there is no docShell to set");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 TabParent::GetTooltipText(nsAString & aTooltipText)
 {
   aTooltipText.Truncate();
   return NS_OK;
 }
 
 PDocumentRendererParent*
 TabParent::AllocPDocumentRenderer(const nsRect& documentRect,
--- a/netwerk/base/public/nsISecureBrowserUI.idl
+++ b/netwerk/base/public/nsISecureBrowserUI.idl
@@ -3,23 +3,21 @@
  * 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"
 
 interface nsIDOMWindow;
 interface nsIDOMElement;
-interface nsIDocShell;
 
-[scriptable, uuid(e97e5688-add2-4a1d-acae-396d7702e382)]
+[scriptable, uuid(081e31e0-a144-11d3-8c7c-00609792278c)]
 interface nsISecureBrowserUI : nsISupports
 {
     void init(in nsIDOMWindow window);
-    void setDocShell(in nsIDocShell docShell);
 
     readonly attribute unsigned long state;
     readonly attribute AString tooltipText;
 };
 
 %{C++
 #define NS_SECURE_BROWSER_UI_CONTRACTID "@mozilla.org/secure_browser_ui;1"
 %}
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -14,17 +14,16 @@
 #include "nsSecureBrowserUIImpl.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIObserverService.h"
 #include "nsCURILoader.h"
 #include "nsIDocShell.h"
-#include "nsIDocShellTreeItem.h"
 #include "nsIDocument.h"
 #include "nsIPrincipal.h"
 #include "nsIDOMElement.h"
 #include "nsPIDOMWindow.h"
 #include "nsIContent.h"
 #include "nsIWebProgress.h"
 #include "nsIWebProgressListener.h"
 #include "nsIChannel.h"
@@ -282,31 +281,22 @@ nsSecureBrowserUIImpl::MapInternalToExte
     case lis_no_security:
       *aState = STATE_IS_INSECURE;
       break;
   }
 
   if (ev && (*aState & STATE_IS_SECURE))
     *aState |= nsIWebProgressListener::STATE_IDENTITY_EV_TOPLEVEL;
 
-  nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShell);
-  if (!docShell)
+  nsCOMPtr<nsPIDOMWindow> piwin = do_QueryReferent(mWindow);
+  if (!piwin)
     return NS_OK;
 
-  int32_t docShellType;
-  // For content docShell's, the mixed content security state is set on the root docShell.
-  if (NS_SUCCEEDED(docShell->GetItemType(&docShellType)) && docShellType == nsIDocShellTreeItem::typeContent) {
-    nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(docShell));
-    nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-    docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
-    NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!");
-    docShell = do_QueryInterface(sameTypeRoot);
-    if (!docShell)
-      return NS_OK;
-  }
+  nsIDocShell* docShell = piwin->GetDocShell();
+  MOZ_ASSERT(docShell);
 
   // Has a Mixed Content Load initiated in nsMixedContentBlocker?
   // If so, the state should be broken; overriding the previous state
   // set by the lock parameter.
   if (docShell->GetHasMixedActiveContentLoaded() &&
       docShell->GetHasMixedDisplayContentLoaded()) {
       *aState = STATE_IS_BROKEN |
                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT |
@@ -325,24 +315,16 @@ nsSecureBrowserUIImpl::MapInternalToExte
 
   if (docShell->GetHasMixedDisplayContentBlocked())
     *aState |= nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSecureBrowserUIImpl::SetDocShell(nsIDocShell *aDocShell)
-{
-  nsresult rv;
-  mDocShell = do_GetWeakReference(aDocShell, &rv);
-  return rv;
-}
-
-NS_IMETHODIMP
 nsSecureBrowserUIImpl::GetTooltipText(nsAString& aText)
 {
   lockIconState state;
   nsXPIDLString tooltip;
 
   {
     ReentrantMonitorAutoEnter lock(mReentrantMonitor);
     state = mNotifiedSecurityState;
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.h
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.h
@@ -12,17 +12,16 @@
 #include "nsString.h"
 #include "nsIObserver.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIStringBundle.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIDocShell.h"
-#include "nsIDocShellTreeItem.h"
 #include "nsIWebProgressListener.h"
 #include "nsIFormSubmitObserver.h"
 #include "nsIURI.h"
 #include "nsISecurityEventSink.h"
 #include "nsWeakReference.h"
 #include "nsISSLStatusProvider.h"
 #include "nsIAssociatedContentSecurity.h"
 #include "pldhash.h"
@@ -62,17 +61,16 @@ public:
                     nsIURI *actionURL, bool* cancelSubmit);
   NS_IMETHOD NotifyInvalidSubmit(nsIDOMHTMLFormElement* formNode,
                                  nsIArray* invalidElements) { return NS_OK; }
   
 protected:
   mozilla::ReentrantMonitor mReentrantMonitor;
   
   nsWeakPtr mWindow;
-  nsWeakPtr mDocShell;
   nsCOMPtr<nsINetUtil> mIOService;
   nsCOMPtr<nsIStringBundle> mStringBundle;
   nsCOMPtr<nsIURI> mCurrentURI;
   nsCOMPtr<nsISecurityEventSink> mToplevelEventSink;
   
   enum lockIconState {
     lis_no_security,
     lis_broken_security,