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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 874003002: Oilpan: dispose ServiceWorker (and registration) objects earlier. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidying Created 5 years, 11 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/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index ba7061c3247cf0dc2dfcb425fca63af985c43a52..2771047dc03fc86c4bdd0ef9c6db7d96b6de1af3 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -145,6 +145,7 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
, m_stopped(false)
{
ASSERT(m_outerRegistration);
+ ThreadState::current()->registerPreFinalizer(*this);
if (!executionContext)
return;
@@ -153,6 +154,17 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
m_outerRegistration->setProxy(this);
}
+ServiceWorkerRegistration::~ServiceWorkerRegistration()
+{
+ ASSERT(!m_outerRegistration);
+}
+
+void ServiceWorkerRegistration::dispose()
+{
+ // See ServiceWorker::dispose() comment why this explicit dispose() action is needed.
+ m_outerRegistration.clear();
+}
+
void ServiceWorkerRegistration::trace(Visitor* visitor)
{
visitor->trace(m_installing);
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698