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

Side by Side Diff: Source/modules/background_sync/SyncCallbacks.h

Issue 1311053002: [BackgroundSync] Use appopriate type parameters for WebCallbacks (2/4) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SyncCallbacks_h 5 #ifndef SyncCallbacks_h
6 #define SyncCallbacks_h 6 #define SyncCallbacks_h
7 7
8 #include "platform/heap/Handle.h" 8 #include "platform/heap/Handle.h"
9 #include "public/platform/WebCallbacks.h" 9 #include "public/platform/WebCallbacks.h"
10 #include "public/platform/modules/background_sync/WebSyncProvider.h" 10 #include "public/platform/modules/background_sync/WebSyncProvider.h"
(...skipping 13 matching lines...) Expand all
24 // SyncRegistrationCallbacks is an implementation of WebSyncRegistrationCallback s 24 // SyncRegistrationCallbacks is an implementation of WebSyncRegistrationCallback s
25 // that will resolve the underlying promise depending on the result passed to 25 // that will resolve the underlying promise depending on the result passed to
26 // the callback. It takes a ServiceWorkerRegistration in its constructor and 26 // the callback. It takes a ServiceWorkerRegistration in its constructor and
27 // will pass it to the SyncRegistration. 27 // will pass it to the SyncRegistration.
28 class SyncRegistrationCallbacks final : public WebSyncRegistrationCallbacks { 28 class SyncRegistrationCallbacks final : public WebSyncRegistrationCallbacks {
29 WTF_MAKE_NONCOPYABLE(SyncRegistrationCallbacks); 29 WTF_MAKE_NONCOPYABLE(SyncRegistrationCallbacks);
30 public: 30 public:
31 SyncRegistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistration* ); 31 SyncRegistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistration* );
32 ~SyncRegistrationCallbacks() override; 32 ~SyncRegistrationCallbacks() override;
33 33
34 void onSuccess(WebSyncRegistration*) override; 34 void onSuccess(WebPassOwnPtr<WebSyncRegistration>) override;
35 void onError(WebSyncError*) override; 35 void onError(const WebSyncError&) override;
36 36
37 private: 37 private:
38 Persistent<ScriptPromiseResolver> m_resolver; 38 Persistent<ScriptPromiseResolver> m_resolver;
39 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 39 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
40 }; 40 };
41 41
42 // SyncNotifyWhenDoneCallbacks is an implementation of 42 // SyncNotifyWhenDoneCallbacks is an implementation of
43 // WebSyncNotifyWhenDoneCallbacks that will resolve the underlying promise 43 // WebSyncNotifyWhenDoneCallbacks that will resolve the underlying promise
44 // depending on the result passed to the callback. It takes a 44 // depending on the result passed to the callback. It takes a
45 // ServiceWorkerRegistration in its constructor and will pass it to the 45 // ServiceWorkerRegistration in its constructor and will pass it to the
46 // SyncProvider. 46 // SyncProvider.
47 class SyncNotifyWhenDoneCallbacks final : public WebSyncNotifyWhenDoneCallbacks { 47 class SyncNotifyWhenDoneCallbacks final : public WebSyncNotifyWhenDoneCallbacks {
48 WTF_MAKE_NONCOPYABLE(SyncNotifyWhenDoneCallbacks); 48 WTF_MAKE_NONCOPYABLE(SyncNotifyWhenDoneCallbacks);
49 public: 49 public:
50 SyncNotifyWhenDoneCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistratio n*); 50 SyncNotifyWhenDoneCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistratio n*);
51 ~SyncNotifyWhenDoneCallbacks() override; 51 ~SyncNotifyWhenDoneCallbacks() override;
52 52
53 void onSuccess(bool*) override; 53 void onSuccess(bool) override;
54 void onError(WebSyncError*) override; 54 void onError(const WebSyncError&) override;
55 55
56 private: 56 private:
57 Persistent<ScriptPromiseResolver> m_resolver; 57 Persistent<ScriptPromiseResolver> m_resolver;
58 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 58 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
59 }; 59 };
60 60
61 // SyncUnregistrationCallbacks is an implementation of 61 // SyncUnregistrationCallbacks is an implementation of
62 // WebSyncUnregistrationCallbacks that will resolve the underlying promise 62 // WebSyncUnregistrationCallbacks that will resolve the underlying promise
63 // depending on the result passed to the callback. It takes a 63 // depending on the result passed to the callback. It takes a
64 // ServiceWorkerRegistration in its constructor and will pass it to the 64 // ServiceWorkerRegistration in its constructor and will pass it to the
65 // SyncProvider. 65 // SyncProvider.
66 class SyncUnregistrationCallbacks final : public WebSyncUnregistrationCallbacks { 66 class SyncUnregistrationCallbacks final : public WebSyncUnregistrationCallbacks {
67 WTF_MAKE_NONCOPYABLE(SyncUnregistrationCallbacks); 67 WTF_MAKE_NONCOPYABLE(SyncUnregistrationCallbacks);
68 public: 68 public:
69 SyncUnregistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistratio n*); 69 SyncUnregistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistratio n*);
70 ~SyncUnregistrationCallbacks() override; 70 ~SyncUnregistrationCallbacks() override;
71 71
72 void onSuccess(bool*) override; 72 void onSuccess(bool) override;
73 void onError(WebSyncError*) override; 73 void onError(const WebSyncError&) override;
74 74
75 private: 75 private:
76 Persistent<ScriptPromiseResolver> m_resolver; 76 Persistent<ScriptPromiseResolver> m_resolver;
77 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 77 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
78 }; 78 };
79 79
80 // SyncGetRegistrationsCallbacks is an implementation of WebSyncGetRegistrations Callbacks 80 // SyncGetRegistrationsCallbacks is an implementation of WebSyncGetRegistrations Callbacks
81 // that will resolve the underlying promise depending on the result passed to 81 // that will resolve the underlying promise depending on the result passed to
82 // the callback. It takes a ServiceWorkerRegistration in its constructor and 82 // the callback. It takes a ServiceWorkerRegistration in its constructor and
83 // will pass it to the SyncRegistration. 83 // will pass it to the SyncRegistration.
84 class SyncGetRegistrationsCallbacks final : public WebSyncGetRegistrationsCallba cks { 84 class SyncGetRegistrationsCallbacks final : public WebSyncGetRegistrationsCallba cks {
85 WTF_MAKE_NONCOPYABLE(SyncGetRegistrationsCallbacks); 85 WTF_MAKE_NONCOPYABLE(SyncGetRegistrationsCallbacks);
86 public: 86 public:
87 SyncGetRegistrationsCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistrat ion*); 87 SyncGetRegistrationsCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistrat ion*);
88 ~SyncGetRegistrationsCallbacks() override; 88 ~SyncGetRegistrationsCallbacks() override;
89 89
90 void onSuccess(WebVector<WebSyncRegistration*>*) override; 90 void onSuccess(const WebVector<WebSyncRegistration*>&) override;
91 void onError(WebSyncError*) override; 91 void onError(const WebSyncError&) override;
92 92
93 private: 93 private:
94 Persistent<ScriptPromiseResolver> m_resolver; 94 Persistent<ScriptPromiseResolver> m_resolver;
95 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 95 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
96 }; 96 };
97 97
98 // SyncGetPermissionStatusCallbacks is an implementation of 98 // SyncGetPermissionStatusCallbacks is an implementation of
99 // WebSyncGetPermissionStatusCallbacks that will resolve the underlying promise 99 // WebSyncGetPermissionStatusCallbacks that will resolve the underlying promise
100 // depending on the permission status passed to the callback. 100 // depending on the permission status passed to the callback.
101 class SyncGetPermissionStatusCallbacks final : public WebSyncGetPermissionStatus Callbacks { 101 class SyncGetPermissionStatusCallbacks final : public WebSyncGetPermissionStatus Callbacks {
102 WTF_MAKE_NONCOPYABLE(SyncGetPermissionStatusCallbacks); 102 WTF_MAKE_NONCOPYABLE(SyncGetPermissionStatusCallbacks);
103 public: 103 public:
104 SyncGetPermissionStatusCallbacks(ScriptPromiseResolver*, ServiceWorkerRegist ration*); 104 SyncGetPermissionStatusCallbacks(ScriptPromiseResolver*, ServiceWorkerRegist ration*);
105 ~SyncGetPermissionStatusCallbacks() override; 105 ~SyncGetPermissionStatusCallbacks() override;
106 106
107 void onSuccess(WebSyncPermissionStatus*) override; 107 void onSuccess(WebSyncPermissionStatus) override;
108 void onError(WebSyncError*) override; 108 void onError(const WebSyncError&) override;
109 109
110 private: 110 private:
111 static String permissionString(WebSyncPermissionStatus); 111 static String permissionString(WebSyncPermissionStatus);
112 112
113 Persistent<ScriptPromiseResolver> m_resolver; 113 Persistent<ScriptPromiseResolver> m_resolver;
114 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 114 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
115 }; 115 };
116 116
117 } // namespace blink 117 } // namespace blink
118 118
119 #endif // SyncCallbacks_h 119 #endif // SyncCallbacks_h
OLDNEW
« no previous file with comments | « Source/modules/background_sync/PeriodicSyncRegistration.cpp ('k') | Source/modules/background_sync/SyncCallbacks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698