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