Bug 895123 - Change nsFrameLoader::mChildHost from nsCOMPtr<nsIObserver> to nsRefPtr<ContentParent>, 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.
This commit is contained in:
Justin Lebar 2013-07-17 16:34:57 -07:00
parent e27322bb60
commit f55bb48aa5
2 changed files with 15 additions and 10 deletions

View File

@ -294,6 +294,15 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated)
ResetPermissionManagerStatus(); ResetPermissionManagerStatus();
} }
nsFrameLoader::~nsFrameLoader()
{
mNeedsAsyncDestroy = true;
if (mMessageManager) {
mMessageManager->Disconnect();
}
nsFrameLoader::Destroy();
}
nsFrameLoader* nsFrameLoader*
nsFrameLoader::Create(Element* aOwner, bool aNetworkCreated) nsFrameLoader::Create(Element* aOwner, bool aNetworkCreated)
{ {
@ -2067,7 +2076,7 @@ nsFrameLoader::TryRemoteBrowser()
rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin)); rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
mRemoteBrowser->SetBrowserDOMWindow(browserDOMWin); mRemoteBrowser->SetBrowserDOMWindow(browserDOMWin);
mChildHost = mRemoteBrowser->Manager(); mContentParent = mRemoteBrowser->Manager();
} }
return true; return true;
} }

View File

@ -37,6 +37,7 @@ class mozIApplication;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class ContentParent;
class PBrowserParent; class PBrowserParent;
class TabParent; class TabParent;
struct StructuredCloneData; struct StructuredCloneData;
@ -154,13 +155,7 @@ protected:
nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated); nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated);
public: public:
~nsFrameLoader() { ~nsFrameLoader();
mNeedsAsyncDestroy = true;
if (mMessageManager) {
mMessageManager->Disconnect();
}
nsFrameLoader::Destroy();
}
bool AsyncScrollEnabled() const bool AsyncScrollEnabled() const
{ {
@ -435,8 +430,9 @@ private:
// doesn't necessarily correlate with docshell/document visibility. // doesn't necessarily correlate with docshell/document visibility.
bool mVisible : 1; bool mVisible : 1;
// XXX leaking // The ContentParent associated with mRemoteBrowser. This was added as a
nsCOMPtr<nsIObserver> mChildHost; // strong ref in bug 545237, and we're not sure if we can get rid of it.
nsRefPtr<mozilla::dom::ContentParent> mContentParent;
RenderFrameParent* mCurrentRemoteFrame; RenderFrameParent* mCurrentRemoteFrame;
TabParent* mRemoteBrowser; TabParent* mRemoteBrowser;