Chromium Code Reviews| Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| index ca34c934db6fde75f627566dce56db9d4971f728..711d7d750a012a3db5f6d09e0e9b4cec36323805 100644 |
| --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| @@ -45,6 +45,7 @@ |
| #include "core/frame/UseCounter.h" |
| #include "core/frame/csp/ContentSecurityPolicy.h" |
| #include "modules/EventTargetModules.h" |
| +#include "modules/serviceworkers/NavigatorServiceWorker.h" |
| #include "modules/serviceworkers/ServiceWorker.h" |
| #include "modules/serviceworkers/ServiceWorkerContainerClient.h" |
| #include "modules/serviceworkers/ServiceWorkerError.h" |
| @@ -123,8 +124,9 @@ class ServiceWorkerContainer::GetRegistrationForReadyCallback |
| }; |
| ServiceWorkerContainer* ServiceWorkerContainer::create( |
| - ExecutionContext* executionContext) { |
| - return new ServiceWorkerContainer(executionContext); |
| + ExecutionContext* executionContext, |
| + NavigatorServiceWorker* navigator) { |
| + return new ServiceWorkerContainer(executionContext, navigator); |
| } |
| ServiceWorkerContainer::~ServiceWorkerContainer() { |
| @@ -136,11 +138,14 @@ void ServiceWorkerContainer::contextDestroyed() { |
| m_provider->setClient(0); |
| m_provider = nullptr; |
| } |
| + if (m_navigator) |
|
Wez
2016/12/15 17:57:43
Why check m_navigator here? It doesn't look like i
haraken
2016/12/16 01:08:31
It happens only in testing. I can pass in a dummy
Wez
2016/12/16 01:28:35
That would be my suggestion, since it leads to a s
|
| + m_navigator->clearServiceWorker(); |
| } |
| DEFINE_TRACE(ServiceWorkerContainer) { |
| visitor->trace(m_controller); |
| visitor->trace(m_ready); |
| + visitor->trace(m_navigator); |
| EventTargetWithInlineData::trace(visitor); |
| ContextLifecycleObserver::trace(visitor); |
| } |
| @@ -459,8 +464,11 @@ const AtomicString& ServiceWorkerContainer::interfaceName() const { |
| } |
| ServiceWorkerContainer::ServiceWorkerContainer( |
| - ExecutionContext* executionContext) |
| - : ContextLifecycleObserver(executionContext), m_provider(0) { |
| + ExecutionContext* executionContext, |
| + NavigatorServiceWorker* navigator) |
| + : ContextLifecycleObserver(executionContext), |
| + m_provider(0), |
| + m_navigator(navigator) { |
| if (!executionContext) |
| return; |