Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebPushProvider_h | 5 #ifndef WebPushProvider_h |
| 6 #define WebPushProvider_h | 6 #define WebPushProvider_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/modules/push_messaging/WebPushPermissionStatus.h" | 9 #include "public/platform/modules/push_messaging/WebPushPermissionStatus.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class WebServiceWorkerRegistration; | 13 class WebServiceWorkerRegistration; |
| 14 struct WebPushError; | 14 struct WebPushError; |
| 15 struct WebPushSubscription; | 15 struct WebPushSubscription; |
| 16 struct WebPushSubscriptionOptions; | 16 struct WebPushSubscriptionOptions; |
| 17 | 17 |
| 18 using WebPushSubscriptionCallbacks = WebCallbacks<WebPushSubscription*, WebPushE rror*>; | 18 using WebPushSubscriptionCallbacks = WebCallbacks<WebPushSubscription*, WebPushE rror*>; |
| 19 using WebPushPermissionStatusCallbacks = WebCallbacks<WebPushPermissionStatus*, WebPushError*>; | 19 using WebPushPermissionStatusCallbacks = WebCallbacks<WebPushPermissionStatus*, WebPushError*>; |
|
Peter Beverloo
2015/07/27 17:30:09
Why can't we use const WebPushError& for these two
yhirano
2015/07/29 04:22:35
Yeah, that's possible and desirable but changing a
| |
| 20 using WebPushUnsubscribeCallbacks = WebCallbacks<bool*, WebPassOwnPtr<WebPushErr or>>; | 20 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>; |
| 21 | 21 |
| 22 class WebPushProvider { | 22 class WebPushProvider { |
| 23 public: | 23 public: |
| 24 virtual ~WebPushProvider() { } | 24 virtual ~WebPushProvider() { } |
| 25 | 25 |
| 26 // Takes ownership of the WebPushSubscriptionCallbacks. | 26 // Takes ownership of the WebPushSubscriptionCallbacks. |
| 27 // Does not take ownership of the WebServiceWorkerRegistration. | 27 // Does not take ownership of the WebServiceWorkerRegistration. |
| 28 virtual void subscribe(WebServiceWorkerRegistration*, const WebPushSubscript ionOptions&, WebPushSubscriptionCallbacks*) = 0; | 28 virtual void subscribe(WebServiceWorkerRegistration*, const WebPushSubscript ionOptions&, WebPushSubscriptionCallbacks*) = 0; |
| 29 | 29 |
| 30 // Takes ownership of the WebPushSubscriptionCallbacks. | 30 // Takes ownership of the WebPushSubscriptionCallbacks. |
| 31 // Does not take ownership of the WebServiceWorkerRegistration. | 31 // Does not take ownership of the WebServiceWorkerRegistration. |
| 32 virtual void getSubscription(WebServiceWorkerRegistration*, WebPushSubscript ionCallbacks*) = 0; | 32 virtual void getSubscription(WebServiceWorkerRegistration*, WebPushSubscript ionCallbacks*) = 0; |
| 33 | 33 |
| 34 // Takes ownership of the WebPushPermissionStatusCallbacks. | 34 // Takes ownership of the WebPushPermissionStatusCallbacks. |
| 35 // Does not take ownership of the WebServiceWorkerRegistration. | 35 // Does not take ownership of the WebServiceWorkerRegistration. |
| 36 virtual void getPermissionStatus(WebServiceWorkerRegistration*, const WebPus hSubscriptionOptions&, WebPushPermissionStatusCallbacks*) = 0; | 36 virtual void getPermissionStatus(WebServiceWorkerRegistration*, const WebPus hSubscriptionOptions&, WebPushPermissionStatusCallbacks*) = 0; |
| 37 | 37 |
| 38 // Takes ownership if the WebPushUnsubscribeCallbacks. | 38 // Takes ownership if the WebPushUnsubscribeCallbacks. |
| 39 // Does not take ownership of the WebServiceWorkerRegistration. | 39 // Does not take ownership of the WebServiceWorkerRegistration. |
| 40 virtual void unsubscribe(WebServiceWorkerRegistration*, WebPushUnsubscribeCa llbacks*) = 0; | 40 virtual void unsubscribe(WebServiceWorkerRegistration*, WebPushUnsubscribeCa llbacks*) = 0; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace blink | 43 } // namespace blink |
| 44 | 44 |
| 45 #endif // WebPushProvider_h | 45 #endif // WebPushProvider_h |
| OLD | NEW |