| Index: Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
|
| diff --git a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
|
| index 9c183f1d61a0c27713f20e0d22fd6e10a9b36dca..12239d8fd05aa9eed8fce8d9d4d03bb8c1acbcda 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
|
| @@ -47,6 +47,7 @@
|
| #include "modules/serviceworkers/InspectorServiceWorkerCacheAgent.h"
|
| #include "modules/serviceworkers/ServiceWorkerClients.h"
|
| #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
|
| +#include "modules/serviceworkers/ServiceWorkerRegistration.h"
|
| #include "modules/serviceworkers/ServiceWorkerThread.h"
|
| #include "modules/serviceworkers/WaitUntilObserver.h"
|
| #include "platform/network/ResourceRequest.h"
|
| @@ -119,6 +120,11 @@ ServiceWorkerClients* ServiceWorkerGlobalScope::clients()
|
| return m_clients;
|
| }
|
|
|
| +ServiceWorkerRegistration* ServiceWorkerGlobalScope::registration()
|
| +{
|
| + return m_registration;
|
| +}
|
| +
|
| void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState)
|
| {
|
| exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
|
| @@ -138,6 +144,15 @@ ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState)
|
| return promise;
|
| }
|
|
|
| +void ServiceWorkerGlobalScope::setRegistration(WebServiceWorkerRegistration* registration)
|
| +{
|
| + if (!executionContext()) {
|
| + ServiceWorkerRegistration::dispose(registration);
|
| + return;
|
| + }
|
| + m_registration = ServiceWorkerRegistration::from(executionContext(), registration);
|
| +}
|
| +
|
| bool ServiceWorkerGlobalScope::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
|
| {
|
| if (m_didEvaluateScript) {
|
| @@ -180,6 +195,7 @@ void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Ev
|
| void ServiceWorkerGlobalScope::trace(Visitor* visitor)
|
| {
|
| visitor->trace(m_clients);
|
| + visitor->trace(m_registration);
|
| visitor->trace(m_caches);
|
| WorkerGlobalScope::trace(visitor);
|
| }
|
|
|