Chromium Code Reviews| Index: Source/modules/background_sync/PeriodicSyncRegistration.h |
| diff --git a/Source/modules/background_sync/PeriodicSyncRegistration.h b/Source/modules/background_sync/PeriodicSyncRegistration.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f2dab48b4b9884ea627c2ca159d7eb4b8e3fbdb7 |
| --- /dev/null |
| +++ b/Source/modules/background_sync/PeriodicSyncRegistration.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PeriodicSyncRegistration_h |
| +#define PeriodicSyncRegistration_h |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "modules/background_sync/PeriodicSyncRegistrationOptions.h" |
| +#include "platform/heap/Handle.h" |
|
jkarlin
2015/04/17 19:04:49
Remove?
iclelland
2015/04/22 14:05:11
Done.
|
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class ServiceWorkerRegistration; |
| +class ScriptPromiseResolver; |
| +class ScriptState; |
| +struct WebSyncRegistration; |
| + |
| +class PeriodicSyncRegistration final : public GarbageCollectedFinalized<PeriodicSyncRegistration>, public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + static PeriodicSyncRegistration* take(ScriptPromiseResolver*, WebSyncRegistration*, ServiceWorkerRegistration*); |
| + static void dispose(WebSyncRegistration* registrationRaw); |
| + |
| + virtual ~PeriodicSyncRegistration(); |
| + |
| + bool hasMinPeriod() const { return !m_minPeriod.isNull(); } |
| + unsigned long minPeriod() const { return m_minPeriod.get(); } |
| + void setMinPeriod(unsigned long value) { m_minPeriod = value; } |
| + |
| + bool hasNetworkState() const { return !m_networkState.isNull(); } |
| + String networkState() const { return m_networkState; } |
| + void setNetworkState(String value) { m_networkState = value; } |
| + |
| + bool hasPowerState() const { return !m_powerState.isNull(); } |
| + String powerState() const { return m_powerState; } |
| + void setPowerState(String value) { m_powerState = value; } |
| + |
| + bool hasTag() const { return !m_tag.isNull(); } |
| + String tag() const { return m_tag; } |
| + void setTag(String value) { m_tag = value; } |
| + |
| + ScriptPromise unregister(ScriptState*); |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + PeriodicSyncRegistration(int64_t id, const PeriodicSyncRegistrationOptions&, ServiceWorkerRegistration*); |
| + |
| + 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
|
| + Nullable<unsigned long> m_minPeriod; |
| + String m_networkState; |
| + String m_powerState; |
| + String m_tag; |
| + |
| + Member<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PeriodicSyncRegistration_h |