Backed out changeset e710acd6ef11 (bug 802366)
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 30 Oct 2012 21:36:32 -0400
changeset 111986 3bc04269c76a5e92473b975ff9108b67b951ba55
parent 111985 b103561f6a8b232c6acd6f9fd15d928174db67e3
child 111987 a2afde35619235c7739dd182febc5fe626ada44c
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs802366
milestone19.0a1
backs oute710acd6ef1170767ca6fd639f8d4f77fc57a976
Backed out changeset e710acd6ef11 (bug 802366)
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
dom/base/nsGlobalWindow.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2810,17 +2810,17 @@ nsDocShell::GetSameTypeParent(nsIDocShel
 
     if (parentType == mItemType) {
         parent.swap(*aParent);
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetSameTypeParentIgnoreBrowserAndAppBoundaries(nsIDocShell** aParent)
+nsDocShell::GetParentIgnoreBrowserFrame(nsIDocShell** aParent)
 {
     NS_ENSURE_ARG_POINTER(aParent);
     *aParent = nullptr;
 
     nsCOMPtr<nsIDocShellTreeItem> parent =
         do_QueryInterface(GetAsSupports(mParent));
     if (!parent)
         return NS_OK;
@@ -12416,17 +12416,17 @@ nsDocShell::GetAppId(uint32_t* aAppId)
 
         *aAppId = mAppId;
         return NS_OK;
     }
 
     MOZ_ASSERT(GetFrameType() != eFrameTypeApp);
 
     nsCOMPtr<nsIDocShell> parent;
-    GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent));
+    GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
 
     if (!parent) {
         *aAppId = nsIScriptSecurityManager::NO_APP_ID;
         return NS_OK;
     }
 
     return parent->GetAppId(aAppId);
 }
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -34,17 +34,17 @@ interface nsISHEntry;
 interface nsILayoutHistoryState;
 interface nsISecureBrowserUI;
 interface nsIDOMStorage;
 interface nsIPrincipal;
 interface nsIWebBrowserPrint;
 interface nsIVariant;
 interface nsIPrivacyTransitionObserver;
 
-[scriptable, builtinclass, uuid(0132C0BE-ACB5-4D61-9B19-01C005E030DA)]
+[scriptable, builtinclass, uuid(e93b2f6a-c543-448b-9239-55c96e31672e)]
 interface nsIDocShell : nsISupports
 {
   /**
    * Loads a given URI.  This will give priority to loading the requested URI
    * in the object implementing	this interface.  If it can't be loaded here
    * however, the URL dispatcher will go through its normal process of content
    * loading.
    *
@@ -642,28 +642,34 @@ interface nsIDocShell : nsISupports
    * This method is [noscript] to reduce the scope. It should be used at very
    * specific moments.
    *
    * Calling setAppId() will mark the frame as an app frame.
    */
   [noscript] void setAppId(in unsigned long appId);
 
   /**
-   * Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
-   * mozbrowser> and <iframe mozapp> boundaries.
+   * Returns the app id of the app the docshell is in. Returns
+   * nsIScriptSecurityManager::NO_APP_ID if the docshell is not in an app.
    */
-  nsIDocShell getSameTypeParentIgnoreBrowserAndAppBoundaries();
+  [infallible] readonly attribute unsigned long appId;
 
   /** 
    * True iff asynchronous panning and zooming is enabled for this
    * docshell.
    */
   readonly attribute bool asyncPanZoomEnabled;
 
   /**
+   * Like GetSameTypeParent, except this ignores <iframe mozbrowser>
+   * boundaries.
+   */
+  nsIDocShell getParentIgnoreBrowserFrame();
+
+  /**
    * The sandbox flags on the docshell. These reflect the value of the sandbox
    * attribute of the associated IFRAME or CSP-protectable content, if
    * existent. See the HTML5 spec for more details.
    * These flags on the docshell reflect the current state of the sandbox
    * attribute, which is modifiable. They are only used when loading new
    * content, sandbox flags are also immutably set on the document when it is
    * loaded.
    * The sandbox flags of a document depend on the sandbox flags on its
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3027,17 +3027,17 @@ nsGlobalWindow::GetRealParent(nsIDOMWind
   FORWARD_TO_OUTER(GetRealParent, (aParent), NS_ERROR_NOT_INITIALIZED);
 
   *aParent = nullptr;
   if (!mDocShell) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDocShell> parent;
-  mDocShell->GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent));
+  mDocShell->GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
 
   if (parent) {
     nsCOMPtr<nsIScriptGlobalObject> globalObject(do_GetInterface(parent));
     NS_ENSURE_SUCCESS(CallQueryInterface(globalObject.get(), aParent),
                       NS_ERROR_FAILURE);
   }
   else {
     *aParent = static_cast<nsIDOMWindow*>(this);
@@ -7107,17 +7107,17 @@ nsGlobalWindow::GetRealFrameElement(nsID
 
   *aFrameElement = NULL;
 
   if (!mDocShell) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDocShell> parent;
-  mDocShell->GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent));
+  mDocShell->GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
 
   if (!parent || parent == mDocShell) {
     // We're at a chrome boundary, don't expose the chrome iframe
     // element to content code.
     return NS_OK;
   }
 
   *aFrameElement = mFrameElement;