Chromium Code Reviews| 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); |