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

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

Issue 1876703002: Oilpan: Replace EAGERLY_FINALIZE in EventTarget's hierarchy with pre-finalizers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index f0490d96d5efd72e428b1c0e662cab5ca536fd0e..f0c3b253023879cff47d7d4eb4cf2a24fe7197c8 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -106,6 +106,7 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
{
ASSERT(m_handle);
ASSERT(!m_handle->registration()->proxy());
+ ThreadState::current()->registerPreFinalizer(this);
if (!executionContext)
return;
@@ -118,6 +119,13 @@ ServiceWorkerRegistration::~ServiceWorkerRegistration()
{
}
+void ServiceWorkerRegistration::dispose()
+{
+ // Promptly clears a raw reference from content/ to an on-heap object
+ // so that content/ doesn't access it in a lazy sweeping phase.
+ m_handle.clear();
+}
+
DEFINE_TRACE(ServiceWorkerRegistration)
{
visitor->trace(m_installing);

Powered by Google App Engine
This is Rietveld 408576698