| 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 10 matching lines...) Expand all Loading... |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 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 WebServiceWorkerContextProxy_h | 31 #include "public/web/modules/serviceworker/WebServiceWorkerContextProxy.h" |
| 32 #define WebServiceWorkerContextProxy_h | |
| 33 | |
| 34 #include "public/platform/WebGeofencingEventType.h" | |
| 35 #include "public/platform/WebMessagePortChannel.h" | |
| 36 #include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" | |
| 37 | |
| 38 namespace blink { | |
| 39 | |
| 40 struct WebCircularGeofencingRegion; | |
| 41 struct WebCrossOriginServiceWorkerClient; | |
| 42 struct WebNotificationData; | |
| 43 class WebServiceWorkerRegistration; | |
| 44 class WebServiceWorkerRequest; | |
| 45 class WebString; | |
| 46 struct WebSyncRegistration; | |
| 47 | |
| 48 // A proxy interface to talk to the worker's GlobalScope implementation. | |
| 49 // All methods of this class must be called on the worker thread. | |
| 50 class WebServiceWorkerContextProxy { | |
| 51 public: | |
| 52 virtual ~WebServiceWorkerContextProxy() { } | |
| 53 | |
| 54 virtual void setRegistration(WebServiceWorkerRegistration*) = 0; | |
| 55 virtual void dispatchActivateEvent(int eventID) = 0; | |
| 56 // FIXME: This needs to pass the active service worker info. | |
| 57 virtual void dispatchInstallEvent(int installEventID) = 0; | |
| 58 virtual void dispatchFetchEvent(int fetchEventID, const WebServiceWorkerRequ
est& webRequest) = 0; | |
| 59 | |
| 60 virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, co
nst WebString& regionID, const WebCircularGeofencingRegion&) = 0; | |
| 61 | |
| 62 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray& channels) = 0; | |
| 63 | |
| 64 virtual void dispatchNotificationClickEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&, int actionIndex) = 0; | |
| 65 | |
| 66 virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; | |
| 67 | |
| 68 virtual void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWork
erClient&, const WebString& message, const WebMessagePortChannelArray&) = 0; | |
| 69 | |
| 70 // Passes ownership of the callbacks. | |
| 71 virtual void dispatchServicePortConnectEvent(WebServicePortConnectEventCallb
acks*, const WebURL& targetURL, const WebString& origin, WebServicePortID) = 0; | |
| 72 | |
| 73 // Once the ServiceWorker has finished handling the sync event, | |
| 74 // didHandleSyncEvent is called on the context client. | |
| 75 virtual void dispatchSyncEvent(int syncEventID, const WebSyncRegistration&)
= 0; | |
| 76 }; | |
| 77 | |
| 78 } // namespace blink | |
| 79 | |
| 80 #endif // WebServiceWorkerContextProxy_h | |
| OLD | NEW |