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

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

Issue 467133002: ServiceWorker: Prevent premature garbage collection on ServiceWorkerRegistration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 4 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: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index 455cf938f645e0b621a2c6ab62ad3218c7b28b06..b33fbda2c7f79aff26f2b10de9cd966da191f963 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -147,6 +147,7 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
, WebServiceWorkerRegistrationProxy(this)
, m_outerRegistration(outerRegistration)
, m_provider(0)
+ , m_stopped(false)
{
ASSERT(m_outerRegistration);
ScriptWrappable::init(this);
@@ -166,4 +167,17 @@ void ServiceWorkerRegistration::trace(Visitor* visitor)
EventTargetWithInlineData::trace(visitor);
}
+bool ServiceWorkerRegistration::hasPendingActivity() const
+{
+ return !m_stopped;
+}
+
+void ServiceWorkerRegistration::stop()
+{
+ if (m_stopped)
+ return;
+ m_stopped = true;
+ m_outerRegistration->proxyStopped();
+}
+
} // namespace blink
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | public/platform/WebServiceWorkerRegistration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698