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

Unified Diff: Source/modules/background_sync/SyncRegistration.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: Addressing first round style issues Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
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 36%
copy from Source/modules/push_messaging/PushSubscription.h
copy to Source/modules/background_sync/SyncRegistration.h
index 91740d26cc24a0f5551bd87ac3f2b71d342f9bc1..9b30ecf0565f3a90aca909f0792485be0675238f 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();
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

Powered by Google App Engine
This is Rietveld 408576698