| 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" |
| 11 #include "public/platform/modules/background_sync/WebSyncRegistration.h" | 11 #include "public/platform/modules/background_sync/WebSyncRegistration.h" |
| 12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 13 #include "wtf/PassRefPtr.h" | 13 #include "wtf/PassRefPtr.h" |
| 14 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class ServiceWorkerRegistration; | 18 class ServiceWorkerRegistration; |
| 19 class ScriptPromiseResolver; | 19 class ScriptPromiseResolver; |
| 20 struct WebSyncError; | 20 struct WebSyncError; |
| 21 struct WebSyncRegistration; | 21 struct WebSyncRegistration; |
| 22 class WebString; | |
| 23 | 22 |
| 24 // SyncRegistrationCallbacks is an implementation of | 23 // SyncRegistrationCallbacks is an implementation of |
| 25 // WebSyncRegistrationCallbacks that will resolve the underlying promise | 24 // WebSyncRegistrationCallbacks that will resolve the underlying promise |
| 26 // depending on the result passed to the callback. It takes a | 25 // depending on the result passed to the callback. It takes a |
| 27 // ServiceWorkerRegistration in its constructor and will pass it to the | 26 // ServiceWorkerRegistration in its constructor and will pass it to the |
| 28 // SyncRegistration. | 27 // SyncRegistration. |
| 29 class SyncRegistrationCallbacks final : public WebSyncRegistrationCallbacks { | 28 class SyncRegistrationCallbacks final : public WebSyncRegistrationCallbacks { |
| 30 WTF_MAKE_NONCOPYABLE(SyncRegistrationCallbacks); | 29 WTF_MAKE_NONCOPYABLE(SyncRegistrationCallbacks); |
| 31 // FIXME(tasak): When making public/platform classes to use PartitionAlloc, | 30 // FIXME(tasak): When making public/platform classes to use PartitionAlloc, |
| 32 // the following macro should be moved to WebCallbacks defined in | 31 // the following macro should be moved to WebCallbacks defined in |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void onError(const WebSyncError&) override; | 66 void onError(const WebSyncError&) override; |
| 68 | 67 |
| 69 private: | 68 private: |
| 70 Persistent<ScriptPromiseResolver> m_resolver; | 69 Persistent<ScriptPromiseResolver> m_resolver; |
| 71 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; | 70 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace blink | 73 } // namespace blink |
| 75 | 74 |
| 76 #endif // SyncCallbacks_h | 75 #endif // SyncCallbacks_h |
| OLD | NEW |