| Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| index ebf4ce7037c8be03cefc7760a1282b98ff213412..1219dff35e06bf3baa2081d180ac96a7373b0094 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| @@ -404,13 +404,25 @@ void LocalFrame::detach(FrameDetachType type)
|
| // back to FrameLoaderClient via WindowProxy.
|
| script().clearForClose();
|
| setView(nullptr);
|
| - willDetachFrameHost();
|
| - InspectorInstrumentation::frameDetachedFromParent(this);
|
| - Frame::detach(type);
|
| +
|
| + m_host->eventHandlerRegistry().didRemoveAllEventHandlers(*localDOMWindow());
|
|
|
| // Signal frame destruction here rather than in the destructor.
|
| // Main motivation is to avoid being dependent on its exact timing (Oilpan.)
|
| LocalFrameLifecycleNotifier::notifyContextDestroyed();
|
| +
|
| + // TODO: Page should take care of updating focus/scrolling instead of Frame.
|
| + // TODO: It's unclear as to why this is called more than once, but it is,
|
| + // so page() could be null.
|
| + if (page() && page()->focusController().focusedFrame() == this)
|
| + page()->focusController().setFocusedFrame(nullptr);
|
| +
|
| + if (page() && page()->scrollingCoordinator() && m_view)
|
| + page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
|
| +
|
| + InspectorInstrumentation::frameDetachedFromParent(this);
|
| + Frame::detach(type);
|
| +
|
| m_supplements.clear();
|
| WeakIdentifierMap<LocalFrame>::notifyObjectDestroyed(this);
|
| }
|
| @@ -447,20 +459,6 @@ bool LocalFrame::shouldClose()
|
| return m_loader.shouldClose();
|
| }
|
|
|
| -void LocalFrame::willDetachFrameHost()
|
| -{
|
| - LocalFrameLifecycleNotifier::notifyWillDetachFrameHost();
|
| -
|
| - // FIXME: Page should take care of updating focus/scrolling instead of Frame.
|
| - // FIXME: It's unclear as to why this is called more than once, but it is,
|
| - // so page() could be null.
|
| - if (page() && page()->focusController().focusedFrame() == this)
|
| - page()->focusController().setFocusedFrame(nullptr);
|
| -
|
| - if (page() && page()->scrollingCoordinator() && m_view)
|
| - page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
|
| -}
|
| -
|
| void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow)
|
| {
|
| // Oilpan: setDOMWindow() cannot be used when finalizing. Which
|
|
|