| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" | 38 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" |
| 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" |
| 40 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 40 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| 41 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" | 41 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" |
| 42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
| 43 #include "wtf/Noncopyable.h" | 43 #include "wtf/Noncopyable.h" |
| 44 #include <memory> | 44 #include <memory> |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class ExecutionContext; |
| 49 class ServiceRegistry; |
| 50 class ServiceWorkerGlobalScope; |
| 48 struct WebCrossOriginServiceWorkerClient; | 51 struct WebCrossOriginServiceWorkerClient; |
| 49 struct WebServiceWorkerClientQueryOptions; | 52 struct WebServiceWorkerClientQueryOptions; |
| 50 class ExecutionContext; | |
| 51 class WebServiceWorkerCacheStorage; | 53 class WebServiceWorkerCacheStorage; |
| 52 class WebServiceWorkerResponse; | 54 class WebServiceWorkerResponse; |
| 53 class WebURL; | 55 class WebURL; |
| 54 class WorkerClients; | 56 class WorkerClients; |
| 55 | 57 |
| 56 // See WebServiceWorkerContextClient for documentation for the methods in this c
lass. | 58 // See WebServiceWorkerContextClient for documentation for the methods in this c
lass. |
| 57 class MODULES_EXPORT ServiceWorkerGlobalScopeClient : public Supplement<WorkerCl
ients> { | 59 class MODULES_EXPORT ServiceWorkerGlobalScopeClient : public Supplement<WorkerCl
ients> { |
| 58 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); | 60 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); |
| 59 DISALLOW_NEW(); | 61 DISALLOW_NEW(); |
| 60 public: | 62 public: |
| 61 virtual ~ServiceWorkerGlobalScopeClient() { } | 63 virtual ~ServiceWorkerGlobalScopeClient() { } |
| 62 | 64 |
| 63 // Called from ServiceWorkerClients. | 65 // Called from ServiceWorkerClients. |
| 64 virtual void getClient(const WebString&, WebServiceWorkerClientCallbacks*) =
0; | 66 virtual void getClient(const WebString&, WebServiceWorkerClientCallbacks*) =
0; |
| 65 virtual void getClients(const WebServiceWorkerClientQueryOptions&, WebServic
eWorkerClientsCallbacks*) = 0; | 67 virtual void getClients(const WebServiceWorkerClientQueryOptions&, WebServic
eWorkerClientsCallbacks*) = 0; |
| 66 virtual void openWindow(const WebURL&, WebServiceWorkerClientCallbacks*) = 0
; | 68 virtual void openWindow(const WebURL&, WebServiceWorkerClientCallbacks*) = 0
; |
| 67 virtual void setCachedMetadata(const WebURL&, const char*, size_t) = 0; | 69 virtual void setCachedMetadata(const WebURL&, const char*, size_t) = 0; |
| 68 virtual void clearCachedMetadata(const WebURL&) = 0; | 70 virtual void clearCachedMetadata(const WebURL&) = 0; |
| 69 | 71 |
| 70 virtual WebURL scope() const = 0; | 72 virtual WebURL scope() const = 0; |
| 71 | 73 |
| 74 virtual void didInitializeContext(ServiceWorkerGlobalScope*) = 0; |
| 72 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
) = 0; | 75 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
) = 0; |
| 73 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult) = 0; | 76 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult) = 0; |
| 74 // Calling respondToFetchEvent without response means no response was | 77 // Calling respondToFetchEvent without response means no response was |
| 75 // provided by the service worker in the fetch events, so fallback to native
. | 78 // provided by the service worker in the fetch events, so fallback to native
. |
| 76 virtual void respondToFetchEvent(int responseID) = 0; | 79 virtual void respondToFetchEvent(int responseID) = 0; |
| 77 virtual void respondToFetchEvent(int responseID, const WebServiceWorkerRespo
nse&) = 0; | 80 virtual void respondToFetchEvent(int responseID, const WebServiceWorkerRespo
nse&) = 0; |
| 78 virtual void didHandleFetchEvent(int eventFinishID, WebServiceWorkerEventRes
ult) = 0; | 81 virtual void didHandleFetchEvent(int eventFinishID, WebServiceWorkerEventRes
ult) = 0; |
| 79 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result) = 0; | 82 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result) = 0; |
| 80 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult) = 0; | 83 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult) = 0; |
| 81 virtual void didHandleNotificationCloseEvent(int eventID, WebServiceWorkerEv
entResult) = 0; | 84 virtual void didHandleNotificationCloseEvent(int eventID, WebServiceWorkerEv
entResult) = 0; |
| 82 virtual void didHandlePushEvent(int pushEventID, WebServiceWorkerEventResult
) = 0; | 85 virtual void didHandlePushEvent(int pushEventID, WebServiceWorkerEventResult
) = 0; |
| 83 virtual void didHandleSyncEvent(int syncEventID, WebServiceWorkerEventResult
) = 0; | 86 virtual void didHandleSyncEvent(int syncEventID, WebServiceWorkerEventResult
) = 0; |
| 84 virtual void postMessageToClient(const WebString& clientUUID, const WebStrin
g& message, std::unique_ptr<WebMessagePortChannelArray>) = 0; | 87 virtual void postMessageToClient(const WebString& clientUUID, const WebStrin
g& message, std::unique_ptr<WebMessagePortChannelArray>) = 0; |
| 85 virtual void postMessageToCrossOriginClient(const WebCrossOriginServiceWorke
rClient&, const WebString& message, std::unique_ptr<WebMessagePortChannelArray>)
= 0; | 88 virtual void postMessageToCrossOriginClient(const WebCrossOriginServiceWorke
rClient&, const WebString& message, std::unique_ptr<WebMessagePortChannelArray>)
= 0; |
| 86 virtual void skipWaiting(WebServiceWorkerSkipWaitingCallbacks*) = 0; | 89 virtual void skipWaiting(WebServiceWorkerSkipWaitingCallbacks*) = 0; |
| 87 virtual void claim(WebServiceWorkerClientsClaimCallbacks*) = 0; | 90 virtual void claim(WebServiceWorkerClientsClaimCallbacks*) = 0; |
| 88 virtual void focus(const WebString& clientUUID, WebServiceWorkerClientCallba
cks*) = 0; | 91 virtual void focus(const WebString& clientUUID, WebServiceWorkerClientCallba
cks*) = 0; |
| 89 virtual void navigate(const WebString& clientUUID, const WebURL&, WebService
WorkerClientCallbacks*) = 0; | 92 virtual void navigate(const WebString& clientUUID, const WebURL&, WebService
WorkerClientCallbacks*) = 0; |
| 90 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>&) = 0; | 93 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>&) = 0; |
| 91 | 94 |
| 92 static const char* supplementName(); | 95 static const char* supplementName(); |
| 93 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); | 96 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); |
| 97 static ServiceWorkerGlobalScopeClient* from(WorkerClients*); |
| 94 | 98 |
| 95 protected: | 99 protected: |
| 96 ServiceWorkerGlobalScopeClient() { } | 100 ServiceWorkerGlobalScopeClient() { } |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 MODULES_EXPORT void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*
, ServiceWorkerGlobalScopeClient*); | 103 MODULES_EXPORT void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*
, ServiceWorkerGlobalScopeClient*); |
| 100 | 104 |
| 101 } // namespace blink | 105 } // namespace blink |
| 102 | 106 |
| 103 #endif // ServiceWorkerGlobalScopeClient_h | 107 #endif // ServiceWorkerGlobalScopeClient_h |
| OLD | NEW |