mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1064439, part 11 - Make nsWebBrowser::mDocShellTreeOwner into an nsRefPtr. r=jst
This commit is contained in:
parent
f2af6c4451
commit
edf00d8802
@ -64,7 +64,7 @@ static NS_DEFINE_CID(kChildCID, NS_CHILD_CID);
|
||||
//*** nsWebBrowser: Object Management
|
||||
//*****************************************************************************
|
||||
|
||||
nsWebBrowser::nsWebBrowser() : mDocShellTreeOwner(nullptr),
|
||||
nsWebBrowser::nsWebBrowser() :
|
||||
mInitInfo(nullptr),
|
||||
mContentType(typeContentWrapper),
|
||||
mActivating(false),
|
||||
@ -101,11 +101,10 @@ NS_IMETHODIMP nsWebBrowser::InternalDestroy()
|
||||
|
||||
SetDocShell(nullptr);
|
||||
|
||||
if (mDocShellTreeOwner)
|
||||
{
|
||||
if (mDocShellTreeOwner) {
|
||||
mDocShellTreeOwner->WebBrowser(nullptr);
|
||||
NS_RELEASE(mDocShellTreeOwner);
|
||||
}
|
||||
mDocShellTreeOwner = nullptr;
|
||||
}
|
||||
if (mInitInfo)
|
||||
{
|
||||
delete mInitInfo;
|
||||
@ -502,8 +501,8 @@ NS_IMETHODIMP nsWebBrowser::FindItemWithName(const char16_t *aName,
|
||||
NS_ASSERTION(mDocShellTreeOwner, "This should always be set when in this situation");
|
||||
|
||||
return mDocShell->FindItemWithName(aName,
|
||||
static_cast<nsIDocShellTreeOwner*>(mDocShellTreeOwner),
|
||||
aOriginalRequestor, _retval);
|
||||
static_cast<nsIDocShellTreeOwner*>(mDocShellTreeOwner),
|
||||
aOriginalRequestor, _retval);
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
@ -1633,8 +1632,6 @@ NS_IMETHODIMP nsWebBrowser::EnsureDocShellTreeOwner()
|
||||
return NS_OK;
|
||||
|
||||
mDocShellTreeOwner = new nsDocShellTreeOwner();
|
||||
|
||||
NS_ADDREF(mDocShellTreeOwner);
|
||||
mDocShellTreeOwner->WebBrowser(this);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsDocShellTreeOwner.h"
|
||||
|
||||
// Core Includes
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
// Interfaces needed
|
||||
@ -125,7 +126,7 @@ protected:
|
||||
virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion) MOZ_OVERRIDE;
|
||||
|
||||
protected:
|
||||
nsDocShellTreeOwner* mDocShellTreeOwner;
|
||||
nsRefPtr<nsDocShellTreeOwner> mDocShellTreeOwner;
|
||||
nsCOMPtr<nsIDocShell> mDocShell;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
|
||||
nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
|
||||
|
Loading…
Reference in New Issue
Block a user