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

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

Issue 1744973002: Make AbstractWorker a ContextLifecycleObserver rather than an ActiveDOMObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp
index 9ad3c6ac88a5eae82d28cba638de552633bc5e8b..16d287892bc8d21b2b1d550f3473cf21fe7da29f 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp
@@ -111,18 +111,11 @@ ServiceWorker* ServiceWorker::from(ExecutionContext* executionContext, PassOwnPt
bool ServiceWorker::hasPendingActivity() const
{
- if (AbstractWorker::hasPendingActivity())
- return true;
- if (m_wasStopped)
+ if (!executionContext())
sof 2016/03/02 19:59:57 Using !executionContext() here rather than an expl
haraken 2016/03/03 02:39:37 Right.
return false;
return m_handle->serviceWorker()->state() != WebServiceWorkerStateRedundant;
}
-void ServiceWorker::stop()
-{
- m_wasStopped = true;
-}
-
ServiceWorker* ServiceWorker::getOrCreate(ExecutionContext* executionContext, PassOwnPtr<WebServiceWorker::Handle> handle)
{
if (!handle)
@@ -134,15 +127,12 @@ ServiceWorker* ServiceWorker::getOrCreate(ExecutionContext* executionContext, Pa
return existingWorker;
}
- ServiceWorker* newWorker = new ServiceWorker(executionContext, handle);
- newWorker->suspendIfNeeded();
- return newWorker;
+ return new ServiceWorker(executionContext, handle);
}
ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<WebServiceWorker::Handle> handle)
: AbstractWorker(executionContext)
, m_handle(handle)
- , m_wasStopped(false)
{
ASSERT(m_handle);
m_handle->serviceWorker()->setProxy(this);
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698