Bug 802366 - Prelude, part 2: Rename GetParentIgnoreBrowserFrame to GetSameTypeParentIgnoreBrowserAndAppBoundaries. r=bz
☠☠ backed out by 3bc04269c76a ☠ ☠
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 30 Oct 2012 15:55:05 -0400
changeset 111930 e710acd6ef1170767ca6fd639f8d4f77fc57a976
parent 111929 86d8067fa9e5e22b785bb6091321fda03932ce91
child 111931 212e1383eb6ed9d9f6c13530e320bc65815501aa
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbz
bugs802366
milestone19.0a1
Bug 802366 - Prelude, part 2: Rename GetParentIgnoreBrowserFrame to GetSameTypeParentIgnoreBrowserAndAppBoundaries. r=bz It's a long name, but at least it's clear.
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::GetParentIgnoreBrowserFrame(nsIDocShell** aParent)
+nsDocShell::GetSameTypeParentIgnoreBrowserAndAppBoundaries(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;
-    GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
+    GetSameTypeParentIgnoreBrowserAndAppBoundaries(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(e93b2f6a-c543-448b-9239-55c96e31672e)]
+[scriptable, builtinclass, uuid(0132C0BE-ACB5-4D61-9B19-01C005E030DA)]
 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,34 +642,28 @@ 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);
 
   /**
-   * Returns the app id of the app the docshell is in. Returns
-   * nsIScriptSecurityManager::NO_APP_ID if the docshell is not in an app.
+   * Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
+   * mozbrowser> and <iframe mozapp> boundaries.
    */
-  [infallible] readonly attribute unsigned long appId;
+  nsIDocShell getSameTypeParentIgnoreBrowserAndAppBoundaries();
 
   /** 
    * 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->GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
+  mDocShell->GetSameTypeParentIgnoreBrowserAndAppBoundaries(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->GetParentIgnoreBrowserFrame(getter_AddRefs(parent));
+  mDocShell->GetSameTypeParentIgnoreBrowserAndAppBoundaries(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;