| OLD | NEW |
| 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 WebSyncProvider_h | 5 #ifndef WebSyncProvider_h |
| 6 #define WebSyncProvider_h | 6 #define WebSyncProvider_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebCommon.h" | 9 #include "public/platform/WebCommon.h" |
| 10 #include "public/platform/WebPassOwnPtr.h" | |
| 11 #include "public/platform/WebString.h" | 10 #include "public/platform/WebString.h" |
| 12 #include "public/platform/WebVector.h" | 11 #include "public/platform/WebVector.h" |
| 13 #include "public/platform/modules/background_sync/WebSyncError.h" | 12 #include "public/platform/modules/background_sync/WebSyncError.h" |
| 14 #include "public/platform/modules/background_sync/WebSyncRegistration.h" | 13 #include "public/platform/modules/background_sync/WebSyncRegistration.h" |
| 15 | 14 |
| 15 #include <memory> |
| 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class WebServiceWorkerRegistration; | 19 class WebServiceWorkerRegistration; |
| 19 using WebSyncRegistrationCallbacks = WebCallbacks<WebPassOwnPtr<WebSyncRegistrat
ion>, const WebSyncError&>; | 20 using WebSyncRegistrationCallbacks = WebCallbacks<std::unique_ptr<WebSyncRegistr
ation>, const WebSyncError&>; |
| 20 using WebSyncGetRegistrationsCallbacks = WebCallbacks<const WebVector<WebSyncReg
istration*>&, const WebSyncError&>; | 21 using WebSyncGetRegistrationsCallbacks = WebCallbacks<const WebVector<WebSyncReg
istration*>&, const WebSyncError&>; |
| 21 | 22 |
| 22 class WebSyncProvider { | 23 class WebSyncProvider { |
| 23 public: | 24 public: |
| 24 virtual ~WebSyncProvider() { } | 25 virtual ~WebSyncProvider() { } |
| 25 | 26 |
| 26 // Takes ownership of the WebSyncRegistrationCallbacks. | 27 // Takes ownership of the WebSyncRegistrationCallbacks. |
| 27 // Does not take ownership of the WebServiceWorkerRegistration. | 28 // Does not take ownership of the WebServiceWorkerRegistration. |
| 28 virtual void registerBackgroundSync(const WebSyncRegistration*, WebServiceWo
rkerRegistration*, WebSyncRegistrationCallbacks*) = 0; | 29 virtual void registerBackgroundSync(const WebSyncRegistration*, WebServiceWo
rkerRegistration*, WebSyncRegistrationCallbacks*) = 0; |
| 29 | 30 |
| 30 // Takes ownership of the WebSyncGetRegistrationsCallbacks. | 31 // Takes ownership of the WebSyncGetRegistrationsCallbacks. |
| 31 // Does not take ownership of the WebServiceWorkerRegistration. | 32 // Does not take ownership of the WebServiceWorkerRegistration. |
| 32 virtual void getRegistrations(WebServiceWorkerRegistration*, WebSyncGetRegis
trationsCallbacks*) = 0; | 33 virtual void getRegistrations(WebServiceWorkerRegistration*, WebSyncGetRegis
trationsCallbacks*) = 0; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace blink | 36 } // namespace blink |
| 36 | 37 |
| 37 #endif // WebSyncProvider_h | 38 #endif // WebSyncProvider_h |
| OLD | NEW |