| 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 #include "public/platform/modules/push_messaging/WebPushSubscription.h" | 10 #include "public/platform/modules/push_messaging/WebPushSubscription.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>; | 24 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>; |
| 25 | 25 |
| 26 class WebPushProvider { | 26 class WebPushProvider { |
| 27 public: | 27 public: |
| 28 virtual ~WebPushProvider() {} | 28 virtual ~WebPushProvider() {} |
| 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 subscribe(WebServiceWorkerRegistration*, | 32 virtual void subscribe(WebServiceWorkerRegistration*, |
| 33 const WebPushSubscriptionOptions&, | 33 const WebPushSubscriptionOptions&, |
| 34 WebPushSubscriptionCallbacks*) = 0; | 34 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; |
| 35 | 35 |
| 36 // Takes ownership of the WebPushSubscriptionCallbacks. | 36 // Takes ownership of the WebPushSubscriptionCallbacks. |
| 37 // Does not take ownership of the WebServiceWorkerRegistration. | 37 // Does not take ownership of the WebServiceWorkerRegistration. |
| 38 virtual void getSubscription(WebServiceWorkerRegistration*, | 38 virtual void getSubscription( |
| 39 WebPushSubscriptionCallbacks*) = 0; | 39 WebServiceWorkerRegistration*, |
| 40 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; |
| 40 | 41 |
| 41 // Takes ownership of the WebPushPermissionStatusCallbacks. | 42 // Takes ownership of the WebPushPermissionStatusCallbacks. |
| 42 // Does not take ownership of the WebServiceWorkerRegistration. | 43 // Does not take ownership of the WebServiceWorkerRegistration. |
| 43 virtual void getPermissionStatus(WebServiceWorkerRegistration*, | 44 virtual void getPermissionStatus( |
| 44 const WebPushSubscriptionOptions&, | 45 WebServiceWorkerRegistration*, |
| 45 WebPushPermissionStatusCallbacks*) = 0; | 46 const WebPushSubscriptionOptions&, |
| 47 std::unique_ptr<WebPushPermissionStatusCallbacks>) = 0; |
| 46 | 48 |
| 47 // Takes ownership if the WebPushUnsubscribeCallbacks. | 49 // Takes ownership if the WebPushUnsubscribeCallbacks. |
| 48 // Does not take ownership of the WebServiceWorkerRegistration. | 50 // Does not take ownership of the WebServiceWorkerRegistration. |
| 49 virtual void unsubscribe(WebServiceWorkerRegistration*, | 51 virtual void unsubscribe(WebServiceWorkerRegistration*, |
| 50 WebPushUnsubscribeCallbacks*) = 0; | 52 std::unique_ptr<WebPushUnsubscribeCallbacks>) = 0; |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace blink | 55 } // namespace blink |
| 54 | 56 |
| 55 #endif // WebPushProvider_h | 57 #endif // WebPushProvider_h |
| OLD | NEW |