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

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

Issue 2583093002: Reduce SuspendableObjects (Closed)
Patch Set: Created 4 years 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 088ee5cbbcbb72f59ae76d1e5c9df310632eb4ea..0f1c552d6650f6cf44032c0cdd711631ecde96e0 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -75,10 +75,7 @@ ServiceWorkerRegistration* ServiceWorkerRegistration::getOrCreate(
return existingRegistration;
}
- ServiceWorkerRegistration* newRegistration =
- new ServiceWorkerRegistration(executionContext, std::move(handle));
- newRegistration->suspendIfNeeded();
- return newRegistration;
+ return new ServiceWorkerRegistration(executionContext, std::move(handle));
}
NavigationPreloadManager* ServiceWorkerRegistration::navigationPreload() {
@@ -132,7 +129,7 @@ ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) {
ServiceWorkerRegistration::ServiceWorkerRegistration(
ExecutionContext* executionContext,
std::unique_ptr<WebServiceWorkerRegistration::Handle> handle)
- : SuspendableObject(executionContext),
+ : ContextLifecycleObserver(executionContext),
m_handle(std::move(handle)),
m_stopped(false) {
ASSERT(m_handle);
@@ -157,7 +154,7 @@ DEFINE_TRACE(ServiceWorkerRegistration) {
visitor->trace(m_active);
visitor->trace(m_navigationPreload);
EventTargetWithInlineData::trace(visitor);
- SuspendableObject::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
Supplementable<ServiceWorkerRegistration>::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698