Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 9c32d1e80efeb8b446a097cd40902fbc0a818a0c..bda7218d8358b434adafb244dbc0a7e948db180b 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -93,7 +93,7 @@ inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host, FrameO
: Frame(client, host, owner)
, m_loader(this)
, m_navigationScheduler(this)
- , m_script(adoptPtr(new ScriptController(this)))
+ , m_script(ScriptController::create(this))
, m_editor(Editor::create(*this))
, m_spellChecker(SpellChecker::create(*this))
, m_selection(FrameSelection::create(this))
@@ -145,6 +145,7 @@ void LocalFrame::trace(Visitor* visitor)
visitor->trace(m_destructionObservers);
visitor->trace(m_loader);
visitor->trace(m_navigationScheduler);
+ visitor->trace(m_view);
visitor->trace(m_pagePopupOwner);
visitor->trace(m_editor);
visitor->trace(m_spellChecker);
@@ -196,7 +197,7 @@ void LocalFrame::detachView()
m_view->prepareForDetach();
}
-void LocalFrame::setView(PassRefPtr<FrameView> view)
+void LocalFrame::setView(PassRefPtrWillBeRawPtr<FrameView> view)
{
detachView();
@@ -210,6 +211,9 @@ void LocalFrame::setView(PassRefPtr<FrameView> view)
eventHandler().clear();
+ if (m_view && !view)
+ m_view->dispose();
haraken 2014/09/26 09:19:25 Just help me understand: Why is it OK to promptly
sof 2014/09/28 08:05:53 A key question. I think it would be safer if the d
sof 2014/09/28 08:20:32 Forgot to say -- no tests exercise code paths that
+
m_view = view;
if (m_view && isMainFrame()) {
@@ -437,7 +441,7 @@ void LocalFrame::createView(const IntSize& viewportSize, const Color& background
setView(nullptr);
- RefPtr<FrameView> frameView;
+ RefPtrWillBeRawPtr<FrameView> frameView = nullptr;
if (isLocalRoot) {
frameView = FrameView::create(this, viewportSize);

Powered by Google App Engine
This is Rietveld 408576698