Chromium Code Reviews| 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); |