mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Bug 1507313 part 1: Convert nsIPresShell::mFrameConstructor into a UniquePtr (rather than an owning raw pointer). r=TYLin
Also, null out its alias mFrameManager before it's deleted. Differential Revision: https://phabricator.services.mozilla.com/D11945 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
5265a3bfd3
commit
52166a8007
@ -747,8 +747,7 @@ PresShell::AccessibleCaretEnabled(nsIDocShell* aDocShell)
|
||||
}
|
||||
|
||||
nsIPresShell::nsIPresShell()
|
||||
: mFrameConstructor(nullptr)
|
||||
, mViewManager(nullptr)
|
||||
: mViewManager(nullptr)
|
||||
, mFrameManager(nullptr)
|
||||
#ifdef ACCESSIBILITY
|
||||
, mDocAccessible(nullptr)
|
||||
@ -892,7 +891,8 @@ PresShell::~PresShell()
|
||||
MOZ_ASSERT(mAllocatedPointers.IsEmpty(), "Some pres arena objects were not freed");
|
||||
|
||||
mStyleSet = nullptr;
|
||||
delete mFrameConstructor;
|
||||
mFrameManager = nullptr;
|
||||
mFrameConstructor = nullptr;
|
||||
|
||||
mCurrentEventContent = nullptr;
|
||||
}
|
||||
@ -929,9 +929,9 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
SetNeedStyleFlush();
|
||||
|
||||
// Create our frame constructor.
|
||||
mFrameConstructor = new nsCSSFrameConstructor(mDocument, this);
|
||||
mFrameConstructor = MakeUnique<nsCSSFrameConstructor>(mDocument, this);
|
||||
|
||||
mFrameManager = mFrameConstructor;
|
||||
mFrameManager = mFrameConstructor.get();
|
||||
|
||||
// The document viewer owns both view manager and pres shell.
|
||||
mViewManager->SetPresShell(this);
|
||||
|
@ -281,7 +281,7 @@ public:
|
||||
|
||||
mozilla::ServoStyleSet* StyleSet() const { return mStyleSet.get(); }
|
||||
|
||||
nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }
|
||||
nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor.get(); }
|
||||
|
||||
/* Enable/disable author style level. Disabling author style disables the entire
|
||||
* author level of the cascade, including the HTML preshint level.
|
||||
@ -1743,7 +1743,7 @@ protected:
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
RefPtr<nsPresContext> mPresContext;
|
||||
mozilla::UniquePtr<mozilla::ServoStyleSet> mStyleSet;
|
||||
nsCSSFrameConstructor* mFrameConstructor; // [OWNS]
|
||||
mozilla::UniquePtr<nsCSSFrameConstructor> mFrameConstructor;
|
||||
nsViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
|
||||
nsPresArena mFrameArena;
|
||||
RefPtr<nsFrameSelection> mSelection;
|
||||
|
Loading…
Reference in New Issue
Block a user