OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 17 matching lines...) Expand all Loading... |
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 WebServiceWorkerContextProxy_h | 31 #ifndef WebServiceWorkerContextProxy_h |
32 #define WebServiceWorkerContextProxy_h | 32 #define WebServiceWorkerContextProxy_h |
33 | 33 |
34 #include "public/platform/WebGeofencingEventType.h" | 34 #include "public/platform/WebGeofencingEventType.h" |
35 #include "public/platform/WebMessagePortChannel.h" | 35 #include "public/platform/WebMessagePortChannel.h" |
36 #include "public/platform/WebPassOwnPtr.h" | 36 #include "public/platform/WebPassOwnPtr.h" |
37 #include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" | 37 #include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" |
| 38 #include "public/platform/modules/serviceworker/WebServiceWorker.h" |
38 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
| 43 class WebServiceWorkerRequest; |
| 44 class WebString; |
42 struct WebCircularGeofencingRegion; | 45 struct WebCircularGeofencingRegion; |
43 struct WebCrossOriginServiceWorkerClient; | 46 struct WebCrossOriginServiceWorkerClient; |
44 struct WebNotificationData; | 47 struct WebNotificationData; |
45 class WebServiceWorkerRequest; | 48 struct WebServiceWorkerClientInfo; |
46 class WebString; | |
47 struct WebSyncRegistration; | 49 struct WebSyncRegistration; |
48 | 50 |
49 // A proxy interface to talk to the worker's GlobalScope implementation. | 51 // A proxy interface to talk to the worker's GlobalScope implementation. |
50 // All methods of this class must be called on the worker thread. | 52 // All methods of this class must be called on the worker thread. |
51 class WebServiceWorkerContextProxy { | 53 class WebServiceWorkerContextProxy { |
52 public: | 54 public: |
53 virtual ~WebServiceWorkerContextProxy() { } | 55 virtual ~WebServiceWorkerContextProxy() { } |
54 | 56 |
55 virtual void setRegistration(WebPassOwnPtr<WebServiceWorkerRegistration::Han
dle>) = 0; | 57 virtual void setRegistration(WebPassOwnPtr<WebServiceWorkerRegistration::Han
dle>) = 0; |
56 | 58 |
57 virtual void dispatchActivateEvent(int eventID) = 0; | 59 virtual void dispatchActivateEvent(int eventID) = 0; |
58 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebMessagePortChannelArray&) = 0; | 60 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebMessagePortChannelArray&, const WebServiceWorkerClientInfo&) = 0
; |
| 61 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebMessagePortChannelArray&, WebPassOwnPtr<WebServiceWorker::Handle
>) = 0; |
59 virtual void dispatchInstallEvent(int eventID) = 0; | 62 virtual void dispatchInstallEvent(int eventID) = 0; |
60 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest&
webRequest) = 0; | 63 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest&
webRequest) = 0; |
61 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe
quest& webRequest) = 0; | 64 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe
quest& webRequest) = 0; |
62 virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, co
nst WebString& regionID, const WebCircularGeofencingRegion&) = 0; | 65 virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, co
nst WebString& regionID, const WebCircularGeofencingRegion&) = 0; |
63 | 66 |
64 // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by | 67 // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by |
65 // default (crbug.com/543198). | 68 // default (crbug.com/543198). |
66 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) = 0; | 69 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) = 0; |
67 | 70 |
68 virtual void dispatchNotificationClickEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&, int actionIndex) = 0; | 71 virtual void dispatchNotificationClickEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&, int actionIndex) = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
79 }; | 82 }; |
80 | 83 |
81 // Once the ServiceWorker has finished handling the sync event, | 84 // Once the ServiceWorker has finished handling the sync event, |
82 // didHandleSyncEvent is called on the context client. | 85 // didHandleSyncEvent is called on the context client. |
83 virtual void dispatchSyncEvent(int syncEventID, const WebSyncRegistration&,
LastChanceOption) = 0; | 86 virtual void dispatchSyncEvent(int syncEventID, const WebSyncRegistration&,
LastChanceOption) = 0; |
84 }; | 87 }; |
85 | 88 |
86 } // namespace blink | 89 } // namespace blink |
87 | 90 |
88 #endif // WebServiceWorkerContextProxy_h | 91 #endif // WebServiceWorkerContextProxy_h |
OLD | NEW |