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

Unified Diff: Source/modules/pushmessaging/PushRegistration.h

Issue 152763002: DO NOT REVIEW Bindings and plumbing for push messaging API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Address some review comments. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/pushmessaging/PushRegistration.h
diff --git a/Source/modules/pushmessaging/PushRegistration.h b/Source/modules/pushmessaging/PushRegistration.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd1980cd7d8a19623f519f7b0a5f311773ba17c3
--- /dev/null
+++ b/Source/modules/pushmessaging/PushRegistration.h
@@ -0,0 +1,39 @@
+// Copyright 2014 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 PushRegistration_h
+#define PushRegistration_h
+
+#include "bindings/v8/ScriptWrappable.h"
+#include "public/platform/WebPushRegistration.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class PushRegistration FINAL : public RefCounted<PushRegistration>, public ScriptWrappable {
+public:
+ // For CallbackPromiseAdapter.
+ typedef blink::WebPushRegistration WebType;
+ static PassRefPtr<PushRegistration> from(WebType* registration)
+ {
+ return adoptRef(new PushRegistration(registration->endpoint, registration->registrationId, registration->channelName));
+ }
+
+ virtual ~PushRegistration();
+
+ const String& pushEndpoint() const { return m_pushEndpoint; }
+ const String& pushRegistrationId() const { return m_pushRegistrationId; }
+ const String& channelName() const { return m_channelName; }
+
+private:
+ PushRegistration(const String& pushEndpoint, const String& pushRegistrationId, const String& channelName);
+
+ String m_pushEndpoint;
+ String m_pushRegistrationId;
+ String m_channelName;
+};
+
+} // namespace WebCore
+
+#endif // PushRegistration_h
« no previous file with comments | « Source/modules/pushmessaging/PushMessagingError.cpp ('k') | Source/modules/pushmessaging/PushRegistration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698