зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1155478 - Use smart pointers for three members of nsIPresShell; r=roc
This commit is contained in:
Родитель
2557a4c19e
Коммит
f9076fe89f
|
@ -1671,13 +1671,13 @@ protected:
|
|||
|
||||
// These are the same Document and PresContext owned by the DocViewer.
|
||||
// we must share ownership.
|
||||
nsIDocument* mDocument; // [STRONG]
|
||||
nsPresContext* mPresContext; // [STRONG]
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsStyleSet* mStyleSet; // [OWNS]
|
||||
nsCSSFrameConstructor* mFrameConstructor; // [OWNS]
|
||||
nsViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
|
||||
nsPresArena mFrameArena;
|
||||
nsFrameSelection* mSelection;
|
||||
nsRefPtr<nsFrameSelection> mSelection;
|
||||
// Pointer into mFrameConstructor - this is purely so that FrameManager() and
|
||||
// GetRootFrame() can be inlined:
|
||||
nsFrameManagerBase* mFrameManager;
|
||||
|
|
|
@ -746,7 +746,6 @@ PresShell::BeforeAfterKeyboardEventEnabled()
|
|||
PresShell::PresShell()
|
||||
: mMouseLocation(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE)
|
||||
{
|
||||
mSelection = nullptr;
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
mReflowCountMgr = new ReflowCountMgr();
|
||||
mReflowCountMgr->SetPresContext(mPresContext);
|
||||
|
@ -835,10 +834,6 @@ PresShell::~PresShell()
|
|||
delete mFrameConstructor;
|
||||
|
||||
mCurrentEventContent = nullptr;
|
||||
|
||||
NS_IF_RELEASE(mPresContext);
|
||||
NS_IF_RELEASE(mDocument);
|
||||
NS_IF_RELEASE(mSelection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -864,7 +859,6 @@ PresShell::Init(nsIDocument* aDocument,
|
|||
}
|
||||
|
||||
mDocument = aDocument;
|
||||
NS_ADDREF(mDocument);
|
||||
mViewManager = aViewManager;
|
||||
|
||||
// Create our frame constructor.
|
||||
|
@ -877,7 +871,6 @@ PresShell::Init(nsIDocument* aDocument,
|
|||
|
||||
// Bind the context to the presentation shell.
|
||||
mPresContext = aPresContext;
|
||||
NS_ADDREF(mPresContext);
|
||||
aPresContext->SetShell(this);
|
||||
|
||||
// Now we can initialize the style set.
|
||||
|
@ -905,7 +898,7 @@ PresShell::Init(nsIDocument* aDocument,
|
|||
}
|
||||
|
||||
|
||||
NS_ADDREF(mSelection = new nsFrameSelection());
|
||||
mSelection = new nsFrameSelection();
|
||||
|
||||
mSelection->Init(this, nullptr);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче