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 PeriodicSyncRegistration_h | |
6 #define PeriodicSyncRegistration_h | |
7 | |
8 #include "bindings/core/v8/ScriptPromise.h" | |
9 #include "bindings/core/v8/ScriptWrappable.h" | |
10 #include "modules/background_sync/PeriodicSyncRegistrationOptions.h" | |
11 #include "platform/heap/Handle.h" | |
jkarlin
2015/04/17 19:04:49
Remove?
iclelland
2015/04/22 14:05:11
Done.
| |
12 #include "wtf/text/WTFString.h" | |
13 | |
14 namespace blink { | |
15 | |
16 class ServiceWorkerRegistration; | |
17 class ScriptPromiseResolver; | |
18 class ScriptState; | |
19 struct WebSyncRegistration; | |
20 | |
21 class PeriodicSyncRegistration final : public GarbageCollectedFinalized<Periodic SyncRegistration>, public ScriptWrappable { | |
22 DEFINE_WRAPPERTYPEINFO(); | |
23 public: | |
24 static PeriodicSyncRegistration* take(ScriptPromiseResolver*, WebSyncRegistr ation*, ServiceWorkerRegistration*); | |
25 static void dispose(WebSyncRegistration* registrationRaw); | |
26 | |
27 virtual ~PeriodicSyncRegistration(); | |
28 | |
29 bool hasMinPeriod() const { return !m_minPeriod.isNull(); } | |
30 unsigned long minPeriod() const { return m_minPeriod.get(); } | |
31 void setMinPeriod(unsigned long value) { m_minPeriod = value; } | |
32 | |
33 bool hasNetworkState() const { return !m_networkState.isNull(); } | |
34 String networkState() const { return m_networkState; } | |
35 void setNetworkState(String value) { m_networkState = value; } | |
36 | |
37 bool hasPowerState() const { return !m_powerState.isNull(); } | |
38 String powerState() const { return m_powerState; } | |
39 void setPowerState(String value) { m_powerState = value; } | |
40 | |
41 bool hasTag() const { return !m_tag.isNull(); } | |
42 String tag() const { return m_tag; } | |
43 void setTag(String value) { m_tag = value; } | |
44 | |
45 ScriptPromise unregister(ScriptState*); | |
46 | |
47 DECLARE_TRACE(); | |
48 | |
49 private: | |
50 PeriodicSyncRegistration(int64_t id, const PeriodicSyncRegistrationOptions&, ServiceWorkerRegistration*); | |
51 | |
52 Nullable<int64_t> m_id; | |
jkarlin
2015/04/17 19:04:49
Why nullable? This isn't exposed to javascript.
iclelland
2015/04/22 14:05:10
It was to allow Null (distinct from 0) values to r
| |
53 Nullable<unsigned long> m_minPeriod; | |
54 String m_networkState; | |
55 String m_powerState; | |
56 String m_tag; | |
57 | |
58 Member<ServiceWorkerRegistration> m_serviceWorkerRegistration; | |
59 }; | |
60 | |
61 } // namespace blink | |
62 | |
63 #endif // PeriodicSyncRegistration_h | |
OLD | NEW |