From f55bb48aa54dba249c4205b5f852f426c1340750 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Wed, 17 Jul 2013 16:34:57 -0700 Subject: [PATCH] Bug 895123 - Change nsFrameLoader::mChildHost from nsCOMPtr to nsRefPtr, and rename it to mContentParent. This doesn't change any behavior; the only effect of this change is to make it easier to figure out, from GDB, which ContentParent a nsFrameLoader points to. --- content/base/src/nsFrameLoader.cpp | 11 ++++++++++- content/base/src/nsFrameLoader.h | 14 +++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index e23249f2dc9..6025a94bf5e 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -294,6 +294,15 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated) ResetPermissionManagerStatus(); } +nsFrameLoader::~nsFrameLoader() +{ + mNeedsAsyncDestroy = true; + if (mMessageManager) { + mMessageManager->Disconnect(); + } + nsFrameLoader::Destroy(); +} + nsFrameLoader* nsFrameLoader::Create(Element* aOwner, bool aNetworkCreated) { @@ -2067,7 +2076,7 @@ nsFrameLoader::TryRemoteBrowser() rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin)); mRemoteBrowser->SetBrowserDOMWindow(browserDOMWin); - mChildHost = mRemoteBrowser->Manager(); + mContentParent = mRemoteBrowser->Manager(); } return true; } diff --git a/content/base/src/nsFrameLoader.h b/content/base/src/nsFrameLoader.h index 315a8b0f7f3..7f652a75b45 100644 --- a/content/base/src/nsFrameLoader.h +++ b/content/base/src/nsFrameLoader.h @@ -37,6 +37,7 @@ class mozIApplication; namespace mozilla { namespace dom { +class ContentParent; class PBrowserParent; class TabParent; struct StructuredCloneData; @@ -154,13 +155,7 @@ protected: nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated); public: - ~nsFrameLoader() { - mNeedsAsyncDestroy = true; - if (mMessageManager) { - mMessageManager->Disconnect(); - } - nsFrameLoader::Destroy(); - } + ~nsFrameLoader(); bool AsyncScrollEnabled() const { @@ -435,8 +430,9 @@ private: // doesn't necessarily correlate with docshell/document visibility. bool mVisible : 1; - // XXX leaking - nsCOMPtr mChildHost; + // The ContentParent associated with mRemoteBrowser. This was added as a + // strong ref in bug 545237, and we're not sure if we can get rid of it. + nsRefPtr mContentParent; RenderFrameParent* mCurrentRemoteFrame; TabParent* mRemoteBrowser;