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

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

Issue 1148383012: Oilpan: prefer eager finalization over prefinalizers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: expand&improve comments Created 5 years, 6 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/modules/serviceworkers/ServiceWorker.h » ('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 4f462b7a55a3746ca31e56cc301a64d3f3114a29..7fa2aa90f95564722548942e5f15ac90a5187dcf 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -270,9 +270,6 @@ LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
, m_hasBeenReset(false)
#endif
{
-#if ENABLE(OILPAN)
- ThreadState::current()->registerPreFinalizer(*this);
-#endif
}
void LocalDOMWindow::clearDocument()
@@ -420,30 +417,20 @@ LocalDOMWindow::~LocalDOMWindow()
#if ENABLE(OILPAN)
// Cleared when detaching document.
ASSERT(!m_eventQueue);
-#else
- ASSERT(m_hasBeenReset);
- ASSERT(m_document->isStopped());
- clearDocument();
-#endif
-}
-void LocalDOMWindow::dispose()
-{
// Oilpan: should the LocalDOMWindow be GCed along with its LocalFrame without the
// frame having first notified its observers of imminent destruction, the
// LocalDOMWindow will not have had an opportunity to remove event listeners.
- // Do that here by way of a prefinalizing action.
//
- // (Non-Oilpan, LocalDOMWindow::reset() will always be invoked, the last opportunity
- // being via ~LocalFrame's setDOMWindow() call.)
- if (!frame())
- return;
-
- // (Prefinalizing actions run to completion before the Oilpan GC start to lazily sweep,
- // so keeping them short is worthwhile. Something that's worth keeping in mind when
- // working out where to best place some actions that have to be performed very late
- // on in LocalDOMWindow's lifetime.)
- removeAllEventListeners();
+ // Non-Oilpan, LocalDOMWindow::reset() will always be invoked, the last opportunity
+ // being via ~LocalFrame's setDOMWindow() call. Asserted for below.
+ if (frame())
+ removeAllEventListeners();
+#else
+ ASSERT(m_hasBeenReset);
+ ASSERT(m_document->isStopped());
+ clearDocument();
+#endif
}
ExecutionContext* LocalDOMWindow::executionContext() const
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/modules/serviceworkers/ServiceWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698