Chromium Code Reviews| Index: Source/modules/serviceworkers/ServiceWorker.cpp |
| diff --git a/Source/modules/serviceworkers/ServiceWorker.cpp b/Source/modules/serviceworkers/ServiceWorker.cpp |
| index b1de87b41bdaa829ed13beb2cea9383ad9f28c18..7abb5227cd8ec30df2a3bb8ee6b662f74891d17c 100644 |
| --- a/Source/modules/serviceworkers/ServiceWorker.cpp |
| +++ b/Source/modules/serviceworkers/ServiceWorker.cpp |
| @@ -67,6 +67,18 @@ private: |
| RefPtr<ServiceWorker> m_observer; |
| }; |
| +bool ServiceWorker::hasPendingActivity() const |
| +{ |
| + if (m_contextStopped) |
| + return false; |
| + return m_outerWorker->state() != blink::WebServiceWorkerStateDeactivated; |
| +} |
| + |
| +void ServiceWorker::stop() |
| +{ |
| + m_contextStopped = true; |
|
dominicc (has gone to gerrit)
2014/06/12 22:23:38
Would it make sense to tie m_contextStopped and m_
falken
2014/06/13 19:22:59
Hmm, right it would be good to make the possible c
|
| +} |
| + |
| const AtomicString& ServiceWorker::interfaceName() const |
| { |
| return EventTargetNames::ServiceWorker; |
| @@ -188,6 +200,7 @@ ServiceWorker::ServiceWorker(ExecutionContext* executionContext, PassOwnPtr<blin |
| , WebServiceWorkerProxy(this) |
| , m_outerWorker(worker) |
| , m_isPromisePending(false) |
| + , m_contextStopped(false) |
| { |
| ScriptWrappable::init(this); |
| ASSERT(m_outerWorker); |