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

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

Issue 881683003: Issue FrameDestructionObserver::frameDestroyed() notification on detach. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: weak references no longer needed Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 1647bbce07589501da31460c93a7b04279974b9c..ff583a6130909c5aaa981f80392cf7c201744f30 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -144,6 +144,12 @@ void LocalDOMWindow::WindowFrameObserver::willDetachFrameHost()
m_window->willDetachFrameHost();
}
+void LocalDOMWindow::WindowFrameObserver::frameDestroyed()
+{
+ m_window->frameDestroyed();
+ FrameDestructionObserver::frameDestroyed();
+}
+
class PostMessageTimer final : public NoBaseWillBeGarbageCollectedFinalized<PostMessageTimer>, public SuspendableTimer {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PostMessageTimer);
public:
@@ -594,6 +600,12 @@ void LocalDOMWindow::willDetachFrameHost()
LocalDOMWindow::notifyContextDestroyed();
}
+void LocalDOMWindow::frameDestroyed()
+{
+ willDestroyDocumentInFrame();
+ m_properties.clear();
+}
+
void LocalDOMWindow::willDestroyDocumentInFrame()
{
for (const auto& domWindowProperty : m_properties)
@@ -618,8 +630,7 @@ void LocalDOMWindow::unregisterProperty(DOMWindowProperty* property)
void LocalDOMWindow::reset()
{
- willDestroyDocumentInFrame();
- m_properties.clear();
+ frameDestroyed();
m_screen = nullptr;
m_history = nullptr;
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698