Bug 754089 - remote mozbrowser's messagemanager shouldn't have parent, r=jlebar

This commit is contained in:
Olli Pettay 2012-05-11 10:47:40 +03:00
parent 157bb2b743
commit 0bd7a30ad1
4 changed files with 7 additions and 22 deletions

View File

@ -2171,19 +2171,6 @@ nsFrameLoader::GetRootContentView(nsIContentView** aContentView)
return NS_OK;
}
static already_AddRefed<nsIDocShell>
GetRootDocShell(nsIDocument *aDocument)
{
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aDocument->GetWindow());
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(webNav);
NS_ENSURE_TRUE(treeItem, NULL);
nsCOMPtr<nsIDocShellTreeItem> rootItem;
treeItem->GetRootTreeItem(getter_AddRefs(rootItem));
nsCOMPtr<nsIDocShell> rootDocShell = do_QueryInterface(rootItem);
return rootDocShell.forget();
}
nsresult
nsFrameLoader::EnsureMessageManager()
{
@ -2212,14 +2199,11 @@ nsFrameLoader::EnsureMessageManager()
NS_ENSURE_STATE(cx);
nsCOMPtr<nsIDOMChromeWindow> chromeWindow =
do_QueryInterface(OwnerDoc()->GetWindow());
if (!chromeWindow) {
nsCOMPtr<nsIDocShell> rootDocShell = GetRootDocShell(OwnerDoc());
nsCOMPtr<nsIDOMWindow> rootWindow = do_GetInterface(rootDocShell);
chromeWindow = do_GetInterface(rootWindow);
}
do_QueryInterface(GetOwnerDoc()->GetWindow());
nsCOMPtr<nsIChromeFrameMessageManager> parentManager;
chromeWindow->GetMessageManager(getter_AddRefs(parentManager));
if (chromeWindow) {
chromeWindow->GetMessageManager(getter_AddRefs(parentManager));
}
if (ShouldUseRemoteProcess()) {
mMessageManager = new nsFrameMessageManager(true,

View File

@ -249,7 +249,7 @@ public:
* Return the document that owns this, or null if we don't have
* an owner.
*/
nsIDocument* OwnerDoc() const
nsIDocument* GetOwnerDoc() const
{ return mOwnerContent ? mOwnerContent->OwnerDoc() : nsnull; }
PBrowserParent* GetRemoteBrowser();

View File

@ -7,6 +7,7 @@
let Cu = Components.utils;
let Ci = Components.interfaces;
let Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function debug(msg) {
//dump("BrowserElementChild - " + msg + "\n");

View File

@ -644,7 +644,7 @@ RenderFrameParent::AllocPLayers(LayerManager::LayersBackend* aBackendType)
}
nsRefPtr<LayerManager> lm =
nsContentUtils::LayerManagerForDocument(mFrameLoader->OwnerDoc());
nsContentUtils::LayerManagerForDocument(mFrameLoader->GetOwnerDoc());
ShadowLayerManager* slm = lm->AsShadowManager();
if (!slm) {
*aBackendType = LayerManager::LAYERS_NONE;