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

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

Issue 2142753002: Remove LocalFrameLifecycleObserver::willDetachFrameHost() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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: 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/LocalFrameLifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698