Chromium Code Reviews| 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 SyncManager_h | 5 #ifndef SyncManager_h |
| 6 #define SyncManager_h | 6 #define SyncManager_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "modules/background_sync/BackgroundSyncProvider.h" | |
| 9 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 10 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 class ExecutionContext; | 15 class ExecutionContext; |
| 15 class ScriptPromise; | 16 class ScriptPromise; |
| 16 class ScriptState; | 17 class ScriptState; |
| 17 class ServiceWorkerRegistration; | 18 class ServiceWorkerRegistration; |
| 18 | 19 |
| 19 class SyncManager final : public GarbageCollected<SyncManager>, | 20 class SyncManager final : public GarbageCollected<SyncManager>, |
| 20 public ScriptWrappable { | 21 public ScriptWrappable { |
| 21 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
| 22 | 23 |
| 23 public: | 24 public: |
| 24 static SyncManager* create(ServiceWorkerRegistration* registration) { | 25 static SyncManager* create(ServiceWorkerRegistration* registration) { |
| 25 return new SyncManager(registration); | 26 return new SyncManager(registration); |
| 26 } | 27 } |
| 27 | 28 |
| 28 ScriptPromise registerFunction(ScriptState*, | 29 ScriptPromise registerFunction(ScriptState*, |
| 29 ExecutionContext*, | 30 ExecutionContext*, |
| 30 const String&); | 31 const String&); |
| 31 ScriptPromise getTags(ScriptState*); | 32 ScriptPromise getTags(ScriptState*); |
| 32 | 33 |
| 33 DECLARE_TRACE(); | 34 DECLARE_TRACE(); |
| 34 | 35 |
| 36 enum { UNREGISTERED_SYNC_ID = -1 }; | |
|
jbroman
2016/11/05 22:51:09
nit: kUnregisteredSyncID (Blink name conventions)
adithyas
2016/11/07 19:22:56
Done.
| |
| 37 | |
| 35 private: | 38 private: |
| 36 explicit SyncManager(ServiceWorkerRegistration*); | 39 explicit SyncManager(ServiceWorkerRegistration*); |
| 37 | 40 |
| 41 static BackgroundSyncProvider* backgroundSyncProvider(); | |
| 42 | |
| 38 Member<ServiceWorkerRegistration> m_registration; | 43 Member<ServiceWorkerRegistration> m_registration; |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 } // namespace blink | 46 } // namespace blink |
| 42 | 47 |
| 43 #endif // SyncManager_h | 48 #endif // SyncManager_h |
| OLD | NEW |