From 22489f79201d78116e1538d5b4e143027e2078e2 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Tue, 30 Oct 2012 21:36:29 -0400 Subject: [PATCH] Backed out changeset a6a847452dbf (bug 802366) --- content/base/src/nsDocument.cpp | 2 +- content/base/src/nsFrameLoader.cpp | 159 +++++++---------- content/base/src/nsFrameLoader.h | 24 +-- .../base/src/nsInProcessTabChildGlobal.cpp | 13 +- content/base/src/nsInProcessTabChildGlobal.h | 7 +- content/events/src/nsEventStateManager.cpp | 10 +- .../content/src/nsGenericHTMLFrameElement.cpp | 23 +-- docshell/base/nsDSURIContentListener.cpp | 2 +- docshell/base/nsDocShell.cpp | 161 +++++++++++------- docshell/base/nsDocShell.h | 21 +-- docshell/base/nsIDocShell.idl | 110 +++++------- dom/base/nsGlobalWindow.cpp | 17 +- dom/interfaces/html/nsIMozBrowserFrame.idl | 8 +- dom/ipc/AppProcessPermissions.cpp | 2 +- dom/ipc/ContentChild.cpp | 10 +- dom/ipc/ContentChild.h | 4 +- dom/ipc/ContentParent.cpp | 69 ++++---- dom/ipc/ContentParent.h | 18 +- dom/ipc/PContent.ipdl | 18 +- dom/ipc/TabChild.cpp | 77 ++++----- dom/ipc/TabChild.h | 23 +-- dom/ipc/TabParent.cpp | 26 +-- dom/ipc/TabParent.h | 14 +- .../windowwatcher/src/nsWindowWatcher.cpp | 8 +- xpfe/appshell/src/nsContentTreeOwner.cpp | 2 +- 25 files changed, 383 insertions(+), 445 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 6a9981a10f7c..6bbf826216fb 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -8359,7 +8359,7 @@ HasCrossProcessParent(nsIDocument* aDocument) if (!docShell) { return false; } - return docShell->GetIsBrowserOrApp(); + return docShell->GetIsContentBoundary(); } static bool diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 76b6b9b2480d..bbf60ef88520 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -944,7 +944,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size) EnsureMessageManager(); nsCOMPtr os = services::GetObserverService(); - if (OwnerIsBrowserOrAppFrame() && os && !mRemoteBrowserInitialized) { + if (OwnerIsBrowserFrame() && os && !mRemoteBrowserInitialized) { os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this), "remote-browser-frame-shown", NULL); mRemoteBrowserInitialized = true; @@ -1393,23 +1393,25 @@ nsFrameLoader::SetOwnerContent(Element* aContent) } bool -nsFrameLoader::OwnerIsBrowserOrAppFrame() +nsFrameLoader::OwnerIsBrowserFrame() { nsCOMPtr browserFrame = do_QueryInterface(mOwnerContent); - return browserFrame ? browserFrame->GetReallyIsBrowserOrApp() : false; + bool isBrowser = false; + if (browserFrame) { + browserFrame->GetReallyIsBrowser(&isBrowser); + } + return isBrowser; } bool nsFrameLoader::OwnerIsAppFrame() { nsCOMPtr browserFrame = do_QueryInterface(mOwnerContent); - return browserFrame ? browserFrame->GetReallyIsApp() : false; -} - -bool -nsFrameLoader::OwnerIsBrowserFrame() -{ - return OwnerIsBrowserOrAppFrame() && !OwnerIsAppFrame(); + bool isApp = false; + if (browserFrame) { + browserFrame->GetReallyIsApp(&isApp); + } + return isApp; } void @@ -1422,55 +1424,6 @@ nsFrameLoader::GetOwnerAppManifestURL(nsAString& aOut) } } -already_AddRefed -nsFrameLoader::GetOwnApp() -{ - nsAutoString manifest; - GetOwnerAppManifestURL(manifest); - if (manifest.IsEmpty()) { - return nullptr; - } - - nsCOMPtr appsService = do_GetService(APPS_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(appsService, nullptr); - - nsCOMPtr domApp; - appsService->GetAppByManifestURL(manifest, getter_AddRefs(domApp)); - - nsCOMPtr app = do_QueryInterface(domApp); - MOZ_ASSERT_IF(domApp, app); - return app.forget(); -} - -already_AddRefed -nsFrameLoader::GetOwnOrContainingApp() -{ - nsCOMPtr app = GetOwnApp(); - if (app) { - return app.forget(); - } - - // See if our owner content's principal has an associated app. - uint32_t appId = mOwnerContent->NodePrincipal()->GetAppId(); - MOZ_ASSERT(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID); - - if (appId == nsIScriptSecurityManager::NO_APP_ID || - appId == nsIScriptSecurityManager::UNKNOWN_APP_ID) { - return nullptr; - } - - nsCOMPtr appsService = do_GetService(APPS_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(appsService, nullptr); - - nsCOMPtr domApp; - appsService->GetAppByLocalId(appId, getter_AddRefs(domApp)); - MOZ_ASSERT(domApp); - - app = do_QueryInterface(domApp); - MOZ_ASSERT_IF(domApp, app); - return app.forget(); -} - bool nsFrameLoader::ShouldUseRemoteProcess() { @@ -1487,7 +1440,7 @@ nsFrameLoader::ShouldUseRemoteProcess() // If we're an