| 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 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 16 matching lines...) Expand all Loading... |
| 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 // FIXME(tasak): when making public/platform classes to use PartitionAlloc, | 30 // FIXME(tasak): when making public/platform classes to use PartitionAlloc, |
| 31 // the following macro should be moved to WebCallbacks defined in public/pla
tformWebCallbacks.h. | 31 // the following macro should be moved to WebCallbacks defined in public/pla
tformWebCallbacks.h. |
| 32 USING_FAST_MALLOC(SyncRegistrationCallbacks); | 32 USING_FAST_MALLOC(SyncRegistrationCallbacks); |
| 33 public: | 33 public: |
| 34 SyncRegistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistration*
); | 34 SyncRegistrationCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistration*
); |
| 35 ~SyncRegistrationCallbacks() override; | 35 ~SyncRegistrationCallbacks() override; |
| 36 | 36 |
| 37 void onSuccess(WebPassOwnPtr<WebSyncRegistration>) override; | 37 void onSuccess(std::unique_ptr<WebSyncRegistration>) override; |
| 38 void onError(const WebSyncError&) override; | 38 void onError(const WebSyncError&) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 Persistent<ScriptPromiseResolver> m_resolver; | 41 Persistent<ScriptPromiseResolver> m_resolver; |
| 42 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; | 42 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // SyncGetRegistrationsCallbacks is an implementation of WebSyncGetRegistrations
Callbacks | 45 // SyncGetRegistrationsCallbacks is an implementation of WebSyncGetRegistrations
Callbacks |
| 46 // that will resolve the underlying promise depending on the result passed to | 46 // that will resolve the underlying promise depending on the result passed to |
| 47 // the callback. It takes a ServiceWorkerRegistration in its constructor and | 47 // the callback. It takes a ServiceWorkerRegistration in its constructor and |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 void onError(const WebSyncError&) override; | 59 void onError(const WebSyncError&) override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 Persistent<ScriptPromiseResolver> m_resolver; | 62 Persistent<ScriptPromiseResolver> m_resolver; |
| 63 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; | 63 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| 67 | 67 |
| 68 #endif // SyncCallbacks_h | 68 #endif // SyncCallbacks_h |
| OLD | NEW |