From 00161f8da988397763efa0709a990adac437faa4 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Sun, 15 Dec 2013 12:47:09 -0500 Subject: [PATCH] Backed out changesets a7fc463961ce and 65061e971eb8 (bug 935793) for breaking Travis testing (bug 950441). --- accessible/src/jsat/AccessFu.jsm | 20 ++++++------- b2g/components/ErrorPage.jsm | 8 ++---- content/base/public/nsIFrameLoader.idl | 7 +---- content/base/src/nsFrameLoader.cpp | 32 +++++++++------------ dom/browser-element/BrowserElementParent.js | 16 +++-------- dom/inputmethod/Keyboard.jsm | 8 ++---- dom/ipc/ProcessPriorityManager.cpp | 11 ++----- 7 files changed, 32 insertions(+), 70 deletions(-) diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm index fb7bcdbbd26..c0cf612968c 100644 --- a/accessible/src/jsat/AccessFu.jsm +++ b/accessible/src/jsat/AccessFu.jsm @@ -118,8 +118,8 @@ this.AccessFu = { Output.start(); TouchAdapter.start(); - Services.obs.addObserver(this, 'remote-browser-shown', false); - Services.obs.addObserver(this, 'inprocess-browser-shown', false); + Services.obs.addObserver(this, 'remote-browser-frame-shown', false); + Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false); Services.obs.addObserver(this, 'Accessibility:NextObject', false); Services.obs.addObserver(this, 'Accessibility:PreviousObject', false); Services.obs.addObserver(this, 'Accessibility:Focus', false); @@ -162,8 +162,8 @@ this.AccessFu = { Utils.win.removeEventListener('TabClose', this); Utils.win.removeEventListener('TabSelect', this); - Services.obs.removeObserver(this, 'remote-browser-shown'); - Services.obs.removeObserver(this, 'inprocess-browser-shown'); + Services.obs.removeObserver(this, 'remote-browser-frame-shown'); + Services.obs.removeObserver(this, 'in-process-browser-or-app-frame-shown'); Services.obs.removeObserver(this, 'Accessibility:NextObject'); Services.obs.removeObserver(this, 'Accessibility:PreviousObject'); Services.obs.removeObserver(this, 'Accessibility:Focus'); @@ -304,15 +304,11 @@ this.AccessFu = { case 'Accessibility:MoveByGranularity': this.Input.moveByGranularity(JSON.parse(aData)); break; - case 'remote-browser-shown': - case 'inprocess-browser-shown': + case 'remote-browser-frame-shown': + case 'in-process-browser-or-app-frame-shown': { - // Ignore notifications that aren't from a BrowserOrApp - let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader); - if (!frameLoader.ownerIsBrowserOrAppFrame) { - return; - } - this._handleMessageManager(frameLoader.messageManager); + let mm = aSubject.QueryInterface(Ci.nsIFrameLoader).messageManager; + this._handleMessageManager(mm); break; } } diff --git a/b2g/components/ErrorPage.jsm b/b2g/components/ErrorPage.jsm index ba9cb3af03e..8b6c2985e63 100644 --- a/b2g/components/ErrorPage.jsm +++ b/b2g/components/ErrorPage.jsm @@ -150,16 +150,12 @@ let ErrorPage = { }, init: function errorPageInit() { - Services.obs.addObserver(this, 'inprocess-browser-shown', false); - Services.obs.addObserver(this, 'remote-browser-shown', false); + Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false); + Services.obs.addObserver(this, 'remote-browser-frame-shown', false); }, observe: function errorPageObserve(aSubject, aTopic, aData) { let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader); - // Ignore notifications that aren't from a BrowserOrApp - if (!frameLoader.ownerIsBrowserOrAppFrame) { - return; - } let mm = frameLoader.messageManager; // This won't happen from dom/ipc/preload.js in non-OOP builds. diff --git a/content/base/public/nsIFrameLoader.idl b/content/base/public/nsIFrameLoader.idl index bcbc5fd9302..a2f3e812d62 100644 --- a/content/base/public/nsIFrameLoader.idl +++ b/content/base/public/nsIFrameLoader.idl @@ -111,7 +111,7 @@ interface nsIContentViewManager : nsISupports readonly attribute nsIContentView rootContentView; }; -[scriptable, builtinclass, uuid(a723673b-a26e-4cc6-ae23-ec70df9d97c9)] +[scriptable, builtinclass, uuid(5b9949dc-56f1-47b6-b6d2-3785bb90ed6d)] interface nsIFrameLoader : nsISupports { /** @@ -272,11 +272,6 @@ interface nsIFrameLoader : nsISupports * have a notion of visibility in the parent process when frames are OOP. */ [infallible] attribute boolean visible; - - /** - * Find out whether the owner content really is a browser or app frame - */ - readonly attribute boolean ownerIsBrowserOrAppFrame; }; %{C++ diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 9c74e96b4ae..1c4d99da8d6 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -948,9 +948,9 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size, EnsureMessageManager(); nsCOMPtr os = services::GetObserverService(); - if (os && !mRemoteBrowserInitialized) { + if (OwnerIsBrowserOrAppFrame() && os && !mRemoteBrowserInitialized) { os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this), - "remote-browser-shown", nullptr); + "remote-browser-frame-shown", nullptr); mRemoteBrowserInitialized = true; } } else { @@ -1409,14 +1409,6 @@ nsFrameLoader::OwnerIsBrowserOrAppFrame() return browserFrame ? browserFrame->GetReallyIsBrowserOrApp() : false; } -// The xpcom getter version -NS_IMETHODIMP -nsFrameLoader::GetOwnerIsBrowserOrAppFrame(bool* aResult) -{ - *aResult = OwnerIsBrowserOrAppFrame(); - return NS_OK; -} - bool nsFrameLoader::OwnerIsAppFrame() { @@ -1685,16 +1677,18 @@ nsFrameLoader::MaybeCreateDocShell() mDocShell->SetIsBrowserInsideApp(containingAppId); } - nsCOMPtr os = services::GetObserverService(); - if (os) { - os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this), - "inprocess-browser-shown", nullptr); - } + if (OwnerIsBrowserOrAppFrame()) { + nsCOMPtr os = services::GetObserverService(); + if (os) { + os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this), + "in-process-browser-or-app-frame-shown", nullptr); + } - if (OwnerIsBrowserOrAppFrame() && mMessageManager) { - mMessageManager->LoadFrameScript( - NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js"), - /* allowDelayedLoad = */ true); + if (mMessageManager) { + mMessageManager->LoadFrameScript( + NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js"), + /* allowDelayedLoad = */ true); + } } return NS_OK; diff --git a/dom/browser-element/BrowserElementParent.js b/dom/browser-element/BrowserElementParent.js index b4741d477e0..9bd9dd4280a 100644 --- a/dom/browser-element/BrowserElementParent.js +++ b/dom/browser-element/BrowserElementParent.js @@ -65,8 +65,8 @@ BrowserElementParentFactory.prototype = { // alive for as long as its frame element lives. this._bepMap = new WeakMap(); - Services.obs.addObserver(this, 'remote-browser-shown', /* ownsWeak = */ true); - Services.obs.addObserver(this, 'inprocess-browser-shown', /* ownsWeak = */ true); + Services.obs.addObserver(this, 'remote-browser-frame-shown', /* ownsWeak = */ true); + Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', /* ownsWeak = */ true); }, _browserFramesPrefEnabled: function() { @@ -79,19 +79,11 @@ BrowserElementParentFactory.prototype = { }, _observeInProcessBrowserFrameShown: function(frameLoader) { - // Ignore notifications that aren't from a BrowserOrApp - if (!frameLoader.QueryInterface(Ci.nsIFrameLoader).ownerIsBrowserOrAppFrame) { - return; - } debug("In-process browser frame shown " + frameLoader); this._createBrowserElementParent(frameLoader, /* hasRemoteFrame = */ false); }, _observeRemoteBrowserFrameShown: function(frameLoader) { - // Ignore notifications that aren't from a BrowserOrApp - if (!frameLoader.QueryInterface(Ci.nsIFrameLoader).ownerIsBrowserOrAppFrame) { - return; - } debug("Remote browser frame shown " + frameLoader); this._createBrowserElementParent(frameLoader, /* hasRemoteFrame = */ true); }, @@ -111,10 +103,10 @@ BrowserElementParentFactory.prototype = { this._init(); } break; - case 'remote-browser-shown': + case 'remote-browser-frame-shown': this._observeRemoteBrowserFrameShown(subject); break; - case 'inprocess-browser-shown': + case 'in-process-browser-or-app-frame-shown': this._observeInProcessBrowserFrameShown(subject); break; case 'content-document-global-created': diff --git a/dom/inputmethod/Keyboard.jsm b/dom/inputmethod/Keyboard.jsm index 94456ff8d51..14b56041be6 100644 --- a/dom/inputmethod/Keyboard.jsm +++ b/dom/inputmethod/Keyboard.jsm @@ -44,8 +44,8 @@ this.Keyboard = { }, init: function keyboardInit() { - Services.obs.addObserver(this, 'inprocess-browser-shown', false); - Services.obs.addObserver(this, 'remote-browser-shown', false); + Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false); + Services.obs.addObserver(this, 'remote-browser-frame-shown', false); Services.obs.addObserver(this, 'oop-frameloader-crashed', false); for (let name of this._messageNames) @@ -63,10 +63,6 @@ this.Keyboard = { ppmm.broadcastAsyncMessage('Keyboard:FocusChange', { 'type': 'blur' }); } } else { - // Ignore notifications that aren't from a BrowserOrApp - if (!frameLoader.ownerIsBrowserOrAppFrame) { - return; - } this.initFormsFrameScript(mm); } }, diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp index b9c34d7801c..d6bb96cd352 100644 --- a/dom/ipc/ProcessPriorityManager.cpp +++ b/dom/ipc/ProcessPriorityManager.cpp @@ -602,7 +602,7 @@ ParticularProcessPriorityManager::Init() nsCOMPtr os = services::GetObserverService(); if (os) { os->AddObserver(this, "audio-channel-process-changed", /* ownsWeak */ true); - os->AddObserver(this, "remote-browser-shown", /* ownsWeak */ true); + os->AddObserver(this, "remote-browser-frame-shown", /* ownsWeak */ true); os->AddObserver(this, "ipc:browser-destroyed", /* ownsWeak */ true); os->AddObserver(this, "frameloader-visible-changed", /* ownsWeak */ true); } @@ -674,7 +674,7 @@ ParticularProcessPriorityManager::Observe(nsISupports* aSubject, if (topic.EqualsLiteral("audio-channel-process-changed")) { OnAudioChannelProcessChanged(aSubject); - } else if (topic.EqualsLiteral("remote-browser-shown")) { + } else if (topic.EqualsLiteral("remote-browser-frame-shown")) { OnRemoteBrowserFrameShown(aSubject); } else if (topic.EqualsLiteral("ipc:browser-destroyed")) { OnTabParentDestroyed(aSubject); @@ -747,13 +747,6 @@ ParticularProcessPriorityManager::OnRemoteBrowserFrameShown(nsISupports* aSubjec nsCOMPtr fl = do_QueryInterface(aSubject); NS_ENSURE_TRUE_VOID(fl); - // Ignore notifications that aren't from a BrowserOrApp - bool isBrowserOrApp; - fl->GetOwnerIsBrowserOrAppFrame(&isBrowserOrApp); - if (!isBrowserOrApp) { - return; - } - nsCOMPtr tp; fl->GetTabParent(getter_AddRefs(tp)); NS_ENSURE_TRUE_VOID(tp);