Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: Source/modules/background_sync/SyncManager.h

Issue 963683002: Add IDL and initial Blink API for Background Sync (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remembering how ASCII works Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 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 PushManager_h 5 #ifndef SyncManager_h
6 #define PushManager_h 6 #define SyncManager_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class SyncRegistrationOptions;
14 class ExecutionContext;
13 class ScriptPromise; 15 class ScriptPromise;
16 class ScriptPromiseResolver;
14 class ScriptState; 17 class ScriptState;
15 class ServiceWorkerRegistration; 18 class ServiceWorkerRegistration;
16 19
17 class PushManager final : public GarbageCollected<PushManager>, public ScriptWra ppable { 20 class SyncManager final
21 : public GarbageCollectedFinalized<SyncManager>
22 , public ScriptWrappable {
18 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
19 public: 24 public:
20 static PushManager* create(ServiceWorkerRegistration* registration) 25 static SyncManager* create(ServiceWorkerRegistration* registration)
21 { 26 {
22 return new PushManager(registration); 27 return new SyncManager(registration);
23 } 28 }
29 ~SyncManager() { }
24 30
25 ScriptPromise subscribe(ScriptState*); 31 unsigned long minAllowablePeriod();
26 ScriptPromise getSubscription(ScriptState*);
27 ScriptPromise hasPermission(ScriptState*);
28 32
29 DECLARE_TRACE(); 33 ScriptPromise registerFunction(ScriptState*);
34 ScriptPromise registerFunction(ScriptState*, const SyncRegistrationOptions&) ;
35 ScriptPromise getRegistrations(ScriptState*);
36
37 void trace(Visitor*);
jkarlin 2015/02/27 20:08:13 DECLARE_TRACE();
iclelland 2015/03/02 03:51:12 Done.
30 38
31 private: 39 private:
32 explicit PushManager(ServiceWorkerRegistration*); 40 explicit SyncManager(ServiceWorkerRegistration* registration) : m_registrati on(registration) { }
jkarlin 2015/02/27 20:08:13 Define this in the CPP file and ASSERT(registratio
iclelland 2015/03/02 03:51:12 Done.
33 41
42 unsigned long m_minAllowablePeriod;
jkarlin 2015/02/27 20:08:13 Remove this and use a constant
iclelland 2015/03/02 03:51:11 Done.
34 Member<ServiceWorkerRegistration> m_registration; 43 Member<ServiceWorkerRegistration> m_registration;
35 }; 44 };
36 45
37 } // namespace blink 46 } // namespace blink
38 47
39 #endif // PushManager_h 48 #endif // SyncManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698