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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ServiceWorkerGlobalScopeClient_h | 31 #ifndef ServiceWorkerGlobalScopeClient_h |
32 #define ServiceWorkerGlobalScopeClient_h | 32 #define ServiceWorkerGlobalScopeClient_h |
33 | 33 |
| 34 #include "core/dom/MessagePort.h" |
34 #include "core/workers/WorkerClients.h" | 35 #include "core/workers/WorkerClients.h" |
35 #include "public/platform/WebCallbacks.h" | 36 #include "public/platform/WebCallbacks.h" |
36 #include "public/platform/WebServiceWorkerClientsInfo.h" | 37 #include "public/platform/WebServiceWorkerClientsInfo.h" |
37 #include "public/platform/WebServiceWorkerEventResult.h" | 38 #include "public/platform/WebServiceWorkerEventResult.h" |
38 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
39 #include "wtf/Noncopyable.h" | 40 #include "wtf/Noncopyable.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 class WebURL; | 43 class WebURL; |
43 }; | 44 }; |
(...skipping 10 matching lines...) Expand all Loading... |
54 virtual ~ServiceWorkerGlobalScopeClient() { } | 55 virtual ~ServiceWorkerGlobalScopeClient() { } |
55 | 56 |
56 virtual void getClients(blink::WebServiceWorkerClientsCallbacks*) = 0; | 57 virtual void getClients(blink::WebServiceWorkerClientsCallbacks*) = 0; |
57 virtual blink::WebURL scope() const = 0; | 58 virtual blink::WebURL scope() const = 0; |
58 | 59 |
59 virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEven
tResult) = 0; | 60 virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEven
tResult) = 0; |
60 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult) = 0; | 61 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult) = 0; |
61 // A null response means no valid response was provided by the service worke
r, so fallback to native. | 62 // A null response means no valid response was provided by the service worke
r, so fallback to native. |
62 virtual void didHandleFetchEvent(int fetchEventID, PassRefPtr<Response> = nu
llptr) = 0; | 63 virtual void didHandleFetchEvent(int fetchEventID, PassRefPtr<Response> = nu
llptr) = 0; |
63 virtual void didHandleSyncEvent(int syncEventID) = 0; | 64 virtual void didHandleSyncEvent(int syncEventID) = 0; |
| 65 virtual void postMessageToClient(int clientID, PassRefPtr<SerializedScriptVa
lue> message, PassOwnPtr<MessagePortChannelArray>) = 0; |
64 | 66 |
65 static const char* supplementName(); | 67 static const char* supplementName(); |
66 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); | 68 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); |
67 | 69 |
68 protected: | 70 protected: |
69 ServiceWorkerGlobalScopeClient() { } | 71 ServiceWorkerGlobalScopeClient() { } |
70 }; | 72 }; |
71 | 73 |
72 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil
lBeRawPtr<ServiceWorkerGlobalScopeClient>); | 74 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil
lBeRawPtr<ServiceWorkerGlobalScopeClient>); |
73 | 75 |
74 } // namespace WebCore | 76 } // namespace WebCore |
75 | 77 |
76 #endif // ServiceWorkerGlobalScopeClient_h | 78 #endif // ServiceWorkerGlobalScopeClient_h |
OLD | NEW |