| Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h
|
| diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h
|
| index 1d029bee8361d50ef334ebdba13c332f316f17b1..60b94e55da3b6a66e8ff76cfb28b22427acaed01 100644
|
| --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h
|
| +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h
|
| @@ -31,9 +31,13 @@
|
| #ifndef ServiceWorkerGlobalScopeClientImpl_h
|
| #define ServiceWorkerGlobalScopeClientImpl_h
|
|
|
| +#include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
|
| #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallbacks.h"
|
| +#include "public/platform/modules/serviceworker/service_worker_global_scope.mojom-blink.h"
|
| +#include "wtf/HashMap.h"
|
| #include <memory>
|
|
|
| namespace blink {
|
| @@ -42,12 +46,15 @@ class WebServiceWorkerContextClient;
|
| class WebServiceWorkerResponse;
|
| class WebURL;
|
|
|
| -class ServiceWorkerGlobalScopeClientImpl final : public GarbageCollectedFinalized<ServiceWorkerGlobalScopeClientImpl>, public ServiceWorkerGlobalScopeClient {
|
| +class ServiceWorkerGlobalScopeClientImpl final : public GarbageCollectedFinalized<ServiceWorkerGlobalScopeClientImpl>, public ServiceWorkerGlobalScopeClient, public mojom::blink::ServiceWorkerGlobalScopeClient {
|
| USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerGlobalScopeClientImpl);
|
| + USING_PRE_FINALIZER(ServiceWorkerGlobalScopeClientImpl, dispose);
|
| public:
|
| - static ServiceWorkerGlobalScopeClient* create(WebServiceWorkerContextClient&);
|
| + static ::blink::ServiceWorkerGlobalScopeClient* create(WebServiceWorkerContextClient&);
|
| ~ServiceWorkerGlobalScopeClientImpl() override;
|
|
|
| + void dispose();
|
| +
|
| void getClient(const WebString&, WebServiceWorkerClientCallbacks*) override;
|
| void getClients(const WebServiceWorkerClientQueryOptions&, WebServiceWorkerClientsCallbacks*) override;
|
| void openWindow(const WebURL&, WebServiceWorkerClientCallbacks*) override;
|
| @@ -56,6 +63,7 @@ public:
|
|
|
| WebURL scope() const override;
|
|
|
| + void didInitializeContext(ServiceWorkerGlobalScope*) override;
|
| void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult) override;
|
| void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEventResult) override;
|
| void respondToFetchEvent(int responseID) override;
|
| @@ -74,12 +82,28 @@ public:
|
| void navigate(const WebString& clientUUID, const WebURL&, WebServiceWorkerClientCallbacks*) override;
|
| void registerForeignFetchScopes(const WebVector<WebURL>& subScopes, const WebVector<WebSecurityOrigin>&) override;
|
|
|
| - DEFINE_INLINE_VIRTUAL_TRACE() { ServiceWorkerGlobalScopeClient::trace(visitor); }
|
| + // mojom::blink::ServiceWorkerGlobalScopeClient implementation
|
| + void DispatchPingEvent(const WTF::String& message) override;
|
| + void DispatchFetchEvent(int requestID, int eventFinishID, mojom::blink::ServiceWorkerFetchRequestPtr, const DispatchFetchEventCallback&) override;
|
| +
|
| + DEFINE_INLINE_VIRTUAL_TRACE() {
|
| + visitor->trace(m_parent);
|
| + ::blink::ServiceWorkerGlobalScopeClient::trace(visitor);
|
| + }
|
|
|
| private:
|
| explicit ServiceWorkerGlobalScopeClientImpl(WebServiceWorkerContextClient&);
|
| + // mojo
|
| + mojom::blink::ServiceWorkerGlobalScopeHostPtr& hostProcess();
|
| + ServiceWorkerGlobalScope* workerGlobalScope();
|
|
|
| WebServiceWorkerContextClient& m_client;
|
| + Member<ServiceWorkerGlobalScope> m_parent;
|
| +
|
| + // mojo
|
| + std::unique_ptr<mojo::Binding<mojom::blink::ServiceWorkerGlobalScopeClient>> m_clientBinding;
|
| + mojom::blink::ServiceWorkerGlobalScopeHostPtr m_hostProcess;
|
| + WTF::HashMap<int32_t, mojom::blink::ServiceWorkerGlobalScopeClient::DispatchFetchEventCallback> m_fetchCallbacks;
|
| };
|
|
|
| } // namespace blink
|
|
|