Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: it works \o/ Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "mojo/public/cpp/bindings/struct_ptr.h"
34 #include "public/platform/WebGeofencingEventType.h" 35 #include "public/platform/WebGeofencingEventType.h"
35 #include "public/platform/WebMessagePortChannel.h" 36 #include "public/platform/WebMessagePortChannel.h"
36 #include "public/platform/modules/serviceworker/WebServiceWorker.h" 37 #include "public/platform/modules/serviceworker/WebServiceWorker.h"
37 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" 38 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
38 39
39 #include <memory> 40 #include <memory>
40 41
41 namespace blink { 42 namespace blink {
42 43
44 namespace mojom {
45 namespace blink {
46 class Notification;
47 using NotificationPtr = mojo::StructPtr<Notification>;
48 }
49 }
50
43 class WebServiceWorkerRequest; 51 class WebServiceWorkerRequest;
44 class WebString; 52 class WebString;
45 struct WebCircularGeofencingRegion; 53 struct WebCircularGeofencingRegion;
46 struct WebNotificationData; 54 struct WebNotificationData;
47 struct WebServiceWorkerClientInfo; 55 struct WebServiceWorkerClientInfo;
48 56
49 // A proxy interface to talk to the worker's GlobalScope implementation. 57 // A proxy interface to talk to the worker's GlobalScope implementation.
50 // All methods of this class must be called on the worker thread. 58 // All methods of this class must be called on the worker thread.
51 class WebServiceWorkerContextProxy { 59 class WebServiceWorkerContextProxy {
52 public: 60 public:
53 virtual ~WebServiceWorkerContextProxy() { } 61 virtual ~WebServiceWorkerContextProxy() { }
54 62
55 virtual void setRegistration(std::unique_ptr<WebServiceWorkerRegistration::H andle>) = 0; 63 virtual void setRegistration(std::unique_ptr<WebServiceWorkerRegistration::H andle>) = 0;
56 64
57 virtual void dispatchActivateEvent(int eventID) = 0; 65 virtual void dispatchActivateEvent(int eventID) = 0;
58 virtual void dispatchExtendableMessageEvent(int eventID, const WebString& me ssage, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&, const WebServiceWorkerClientInfo&) = 0; 66 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; 67 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; 68 virtual void dispatchInstallEvent(int eventID) = 0;
61 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest& webRequest) = 0; 69 virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest& webRequest) = 0;
62 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe quest& webRequest) = 0; 70 virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRe quest& webRequest) = 0;
63 virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, co nst WebString& regionID, const WebCircularGeofencingRegion&) = 0; 71 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; 72 virtual void dispatchNotificationClickEvent(int eventID, mojom::blink::Notif icationPtr notification, int actionIndex) = 0;
65 virtual void dispatchNotificationCloseEvent(int eventID, int64_t notificatio nID, const WebNotificationData&) = 0; 73 virtual void dispatchNotificationCloseEvent(int eventID, mojom::blink::Notif icationPtr notification) = 0;
66 virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; 74 virtual void dispatchPushEvent(int eventID, const WebString& data) = 0;
67 75
68 enum LastChanceOption { 76 enum LastChanceOption {
69 IsNotLastChance, 77 IsNotLastChance,
70 IsLastChance 78 IsLastChance
71 }; 79 };
72 80
73 // Once the ServiceWorker has finished handling the sync event, 81 // Once the ServiceWorker has finished handling the sync event,
74 // didHandleSyncEvent is called on the context client. 82 // didHandleSyncEvent is called on the context client.
75 virtual void dispatchSyncEvent(int syncEventID, const WebString& tag, LastCh anceOption) = 0; 83 virtual void dispatchSyncEvent(int syncEventID, const WebString& tag, LastCh anceOption) = 0;
76 }; 84 };
77 85
78 } // namespace blink 86 } // namespace blink
79 87
80 #endif // WebServiceWorkerContextProxy_h 88 #endif // WebServiceWorkerContextProxy_h
OLDNEW
« no previous file with comments | « third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698