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 23 matching lines...) Expand all Loading... |
34 #include "core/dom/MessagePort.h" | 34 #include "core/dom/MessagePort.h" |
35 #include "core/workers/WorkerClients.h" | 35 #include "core/workers/WorkerClients.h" |
36 #include "public/platform/WebCallbacks.h" | 36 #include "public/platform/WebCallbacks.h" |
37 #include "public/platform/WebMessagePortChannel.h" | 37 #include "public/platform/WebMessagePortChannel.h" |
38 #include "public/platform/WebServiceWorkerClientsInfo.h" | 38 #include "public/platform/WebServiceWorkerClientsInfo.h" |
39 #include "public/platform/WebServiceWorkerEventResult.h" | 39 #include "public/platform/WebServiceWorkerEventResult.h" |
40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
41 #include "wtf/Noncopyable.h" | 41 #include "wtf/Noncopyable.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
| 44 class WebServiceWorkerCacheStorage; |
44 class WebURL; | 45 class WebURL; |
45 }; | 46 }; |
46 | 47 |
47 namespace blink { | 48 namespace blink { |
48 | 49 |
49 class ExecutionContext; | 50 class ExecutionContext; |
50 class Response; | 51 class Response; |
51 class WorkerClients; | 52 class WorkerClients; |
52 | 53 |
53 class ServiceWorkerGlobalScopeClient : public WillBeHeapSupplement<WorkerClients
> { | 54 class ServiceWorkerGlobalScopeClient : public WillBeHeapSupplement<WorkerClients
> { |
54 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); | 55 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); |
55 public: | 56 public: |
56 virtual ~ServiceWorkerGlobalScopeClient() { } | 57 virtual ~ServiceWorkerGlobalScopeClient() { } |
57 | 58 |
58 virtual void getClients(blink::WebServiceWorkerClientsCallbacks*) = 0; | 59 virtual void getClients(blink::WebServiceWorkerClientsCallbacks*) = 0; |
59 virtual blink::WebURL scope() const = 0; | 60 virtual blink::WebURL scope() const = 0; |
| 61 virtual blink::WebServiceWorkerCacheStorage* cacheStorage() const = 0; |
60 | 62 |
61 virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEven
tResult) = 0; | 63 virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEven
tResult) = 0; |
62 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult) = 0; | 64 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult) = 0; |
63 // A null response means no valid response was provided by the service worke
r, so fallback to native. | 65 // A null response means no valid response was provided by the service worke
r, so fallback to native. |
64 virtual void didHandleFetchEvent(int fetchEventID, PassRefPtrWillBeRawPtr<Re
sponse> = nullptr) = 0; | 66 virtual void didHandleFetchEvent(int fetchEventID, PassRefPtrWillBeRawPtr<Re
sponse> = nullptr) = 0; |
65 virtual void didHandleSyncEvent(int syncEventID) = 0; | 67 virtual void didHandleSyncEvent(int syncEventID) = 0; |
66 virtual void postMessageToClient(int clientID, const blink::WebString& messa
ge, PassOwnPtr<blink::WebMessagePortChannelArray>) = 0; | 68 virtual void postMessageToClient(int clientID, const blink::WebString& messa
ge, PassOwnPtr<blink::WebMessagePortChannelArray>) = 0; |
67 | 69 |
68 static const char* supplementName(); | 70 static const char* supplementName(); |
69 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); | 71 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); |
70 | 72 |
71 protected: | 73 protected: |
72 ServiceWorkerGlobalScopeClient() { } | 74 ServiceWorkerGlobalScopeClient() { } |
73 }; | 75 }; |
74 | 76 |
75 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil
lBeRawPtr<ServiceWorkerGlobalScopeClient>); | 77 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil
lBeRawPtr<ServiceWorkerGlobalScopeClient>); |
76 | 78 |
77 } // namespace blink | 79 } // namespace blink |
78 | 80 |
79 #endif // ServiceWorkerGlobalScopeClient_h | 81 #endif // ServiceWorkerGlobalScopeClient_h |
OLD | NEW |