Bug 802366 - Prelude, part 2: Rename GetParentIgnoreBrowserFrame to GetSameTypeParentIgnoreBrowserAndAppBoundaries. r=bz
authorJustin Lebar <justin.lebar@gmail.com>
Sat, 10 Nov 2012 10:32:35 -0800
changeset 112938 9b31589a15909cfbad6654eed62774575277e34a
parent 112937 757ae1ab716a5a1724631ad2cfb8e54642ec65f7
child 112939 a93adbd3b6083bee4b39ee2995aedf69230d2aba
push id17844
push userjlebar@mozilla.com
push dateSat, 10 Nov 2012 18:33:18 +0000
treeherdermozilla-inbound@8ed3ac815205 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs802366
milestone19.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 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
@@ -2825,17 +2825,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;
@@ -12437,17 +12437,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
@@ -2943,17 +2943,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);
@@ -7034,17 +7034,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;