| 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 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 WebServiceWorkerContextProxy_h | 31 #ifndef WebServiceWorkerContextProxy_h |
| 32 #define WebServiceWorkerContextProxy_h | 32 #define WebServiceWorkerContextProxy_h |
| 33 | 33 |
| 34 #include "public/platform/WebGeofencingEventType.h" | |
| 35 #include "public/platform/WebMessagePortChannel.h" | 34 #include "public/platform/WebMessagePortChannel.h" |
| 36 #include "public/platform/modules/serviceworker/WebServiceWorker.h" | 35 #include "public/platform/modules/serviceworker/WebServiceWorker.h" |
| 37 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 36 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| 38 | 37 |
| 39 #include <memory> | 38 #include <memory> |
| 40 | 39 |
| 41 namespace blink { | 40 namespace blink { |
| 42 | 41 |
| 43 class WebServiceWorkerRequest; | 42 class WebServiceWorkerRequest; |
| 44 class WebString; | 43 class WebString; |
| 45 struct WebCircularGeofencingRegion; | |
| 46 struct WebNotificationData; | 44 struct WebNotificationData; |
| 47 struct WebServiceWorkerClientInfo; | 45 struct WebServiceWorkerClientInfo; |
| 48 | 46 |
| 49 // A proxy interface to talk to the worker's GlobalScope implementation. | 47 // A proxy interface to talk to the worker's GlobalScope implementation. |
| 50 // All methods of this class must be called on the worker thread. | 48 // All methods of this class must be called on the worker thread. |
| 51 class WebServiceWorkerContextProxy { | 49 class WebServiceWorkerContextProxy { |
| 52 public: | 50 public: |
| 53 virtual ~WebServiceWorkerContextProxy() { } | 51 virtual ~WebServiceWorkerContextProxy() { } |
| 54 | 52 |
| 55 virtual void setRegistration(std::unique_ptr<WebServiceWorkerRegistration::H
andle>) = 0; | 53 virtual void setRegistration(std::unique_ptr<WebServiceWorkerRegistration::H
andle>) = 0; |
| 56 | 54 |
| 57 virtual void dispatchActivateEvent(int eventID) = 0; | 55 virtual void dispatchActivateEvent(int eventID) = 0; |
| 58 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&,
const WebServiceWorkerClientInfo&) = 0; | 56 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&,
const WebServiceWorkerClientInfo&) = 0; |
| 59 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&,
std::unique_ptr<WebServiceWorker::Handle>) = 0; | 57 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me
ssage, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&,
std::unique_ptr<WebServiceWorker::Handle>) = 0; |
| 60 virtual void dispatchInstallEvent(int eventID) = 0; | 58 virtual void dispatchInstallEvent(int eventID) = 0; |
| 61 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest&
webRequest) = 0; | 59 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest&
webRequest) = 0; |
| 62 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe
quest& webRequest) = 0; | 60 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe
quest& webRequest) = 0; |
| 63 virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, co
nst WebString& regionID, const WebCircularGeofencingRegion&) = 0; | |
| 64 virtual void dispatchNotificationClickEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&, int actionIndex) = 0; | 61 virtual void dispatchNotificationClickEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&, int actionIndex) = 0; |
| 65 virtual void dispatchNotificationCloseEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&) = 0; | 62 virtual void dispatchNotificationCloseEvent(int eventID, int64_t notificatio
nID, const WebNotificationData&) = 0; |
| 66 virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; | 63 virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; |
| 67 | 64 |
| 68 enum LastChanceOption { | 65 enum LastChanceOption { |
| 69 IsNotLastChance, | 66 IsNotLastChance, |
| 70 IsLastChance | 67 IsLastChance |
| 71 }; | 68 }; |
| 72 | 69 |
| 73 // Once the ServiceWorker has finished handling the sync event, | 70 // Once the ServiceWorker has finished handling the sync event, |
| 74 // didHandleSyncEvent is called on the context client. | 71 // didHandleSyncEvent is called on the context client. |
| 75 virtual void dispatchSyncEvent(int syncEventID, const WebString& tag, LastCh
anceOption) = 0; | 72 virtual void dispatchSyncEvent(int syncEventID, const WebString& tag, LastCh
anceOption) = 0; |
| 76 }; | 73 }; |
| 77 | 74 |
| 78 } // namespace blink | 75 } // namespace blink |
| 79 | 76 |
| 80 #endif // WebServiceWorkerContextProxy_h | 77 #endif // WebServiceWorkerContextProxy_h |
| OLD | NEW |