Chromium Code Reviews| Index: Source/modules/background_sync/SyncRegistration.h |
| diff --git a/Source/modules/push_messaging/PushSubscription.h b/Source/modules/background_sync/SyncRegistration.h |
| similarity index 34% |
| copy from Source/modules/push_messaging/PushSubscription.h |
| copy to Source/modules/background_sync/SyncRegistration.h |
| index 91740d26cc24a0f5551bd87ac3f2b71d342f9bc1..a8382bcb47ddf461bf8c7d8bca1a0b68b589e97e 100644 |
| --- a/Source/modules/push_messaging/PushSubscription.h |
| +++ b/Source/modules/background_sync/SyncRegistration.h |
| @@ -1,12 +1,13 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// 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 PushSubscription_h |
| -#define PushSubscription_h |
| +#ifndef SyncRegistration_h |
| +#define SyncRegistration_h |
| #include "bindings/core/v8/ScriptPromise.h" |
| #include "bindings/core/v8/ScriptWrappable.h" |
| +#include "modules/background_sync/SyncRegistrationOptions.h" |
| #include "platform/heap/Handle.h" |
| #include "wtf/text/WTFString.h" |
| @@ -15,30 +16,30 @@ namespace blink { |
| class ServiceWorkerRegistration; |
| class ScriptPromiseResolver; |
| class ScriptState; |
| -struct WebPushSubscription; |
| +struct WebSyncRegistration; |
| -class PushSubscription final : public GarbageCollectedFinalized<PushSubscription>, public ScriptWrappable { |
| +class SyncRegistration final : public GarbageCollectedFinalized<SyncRegistration>, public ScriptWrappable { |
| DEFINE_WRAPPERTYPEINFO(); |
| public: |
| - static PushSubscription* take(ScriptPromiseResolver*, WebPushSubscription*, ServiceWorkerRegistration*); |
| - static void dispose(WebPushSubscription* subscriptionRaw); |
| + static SyncRegistration* take(ScriptPromiseResolver*, WebSyncRegistration*, ServiceWorkerRegistration*); |
| + static void dispose(WebSyncRegistration* registrationRaw); |
| - virtual ~PushSubscription(); |
| + virtual ~SyncRegistration(); |
| - const String& endpoint() const { return m_endpoint; } |
| - const String& subscriptionId() const { return m_subscriptionId; } |
| - ScriptPromise unsubscribe(ScriptState*); |
| + const String& id() const { return m_registrationId; } |
| + void options(SyncRegistrationOptions& options) { options = m_syncRegistrationOptions; } |
| + ScriptPromise unregister(ScriptState*); |
| - DECLARE_TRACE(); |
| + void trace(Visitor*); |
|
jkarlin
2015/02/27 20:08:13
DECLARE_TRACE();
iclelland
2015/03/02 03:51:12
Done.
|
| private: |
| - PushSubscription(const String& endpoint, const String& subscriptionId, ServiceWorkerRegistration*); |
| + SyncRegistration(const String& id, const SyncRegistrationOptions&, ServiceWorkerRegistration*); |
| - String m_endpoint; |
| - String m_subscriptionId; |
| + String m_registrationId; |
| + SyncRegistrationOptions m_syncRegistrationOptions; |
| Member<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
| }; |
| } // namespace blink |
| -#endif // PushSubscription_h |
| +#endif // SyncRegistration_h |