Index: Source/modules/push_messaging/PushSubscription.cpp |
diff --git a/Source/modules/push_messaging/PushRegistration.cpp b/Source/modules/push_messaging/PushSubscription.cpp |
similarity index 54% |
rename from Source/modules/push_messaging/PushRegistration.cpp |
rename to Source/modules/push_messaging/PushSubscription.cpp |
index 7c85f95454eda63221717c44189bebf1c499ec90..fb345cc3a0c080f56773ad75c494447ca04c9d44 100644 |
--- a/Source/modules/push_messaging/PushRegistration.cpp |
+++ b/Source/modules/push_messaging/PushSubscription.cpp |
@@ -1,9 +1,9 @@ |
-// 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. |
#include "config.h" |
-#include "modules/push_messaging/PushRegistration.h" |
+#include "modules/push_messaging/PushSubscription.h" |
#include "bindings/core/v8/CallbackPromiseAdapter.h" |
#include "bindings/core/v8/ScriptPromiseResolver.h" |
@@ -11,35 +11,35 @@ |
#include "modules/serviceworkers/ServiceWorkerRegistration.h" |
#include "public/platform/Platform.h" |
#include "public/platform/WebPushProvider.h" |
-#include "public/platform/WebPushRegistration.h" |
+#include "public/platform/WebPushSubscription.h" |
#include "wtf/OwnPtr.h" |
namespace blink { |
-PushRegistration* PushRegistration::take(ScriptPromiseResolver*, WebPushRegistration* pushRegistration, ServiceWorkerRegistration* serviceWorkerRegistration) |
+PushSubscription* PushSubscription::take(ScriptPromiseResolver*, WebPushSubscription* pushSubscription, ServiceWorkerRegistration* serviceWorkerRegistration) |
{ |
- OwnPtr<WebPushRegistration> registration = adoptPtr(pushRegistration); |
- return new PushRegistration(registration->endpoint, registration->registrationId, serviceWorkerRegistration); |
+ OwnPtr<WebPushSubscription> subscription = adoptPtr(pushSubscription); |
+ return new PushSubscription(subscription->endpoint, subscription->subscriptionId, serviceWorkerRegistration); |
} |
-void PushRegistration::dispose(WebPushRegistration* pushRegistration) |
+void PushSubscription::dispose(WebPushSubscription* pushSubscription) |
{ |
- if (pushRegistration) |
- delete pushRegistration; |
+ if (pushSubscription) |
+ delete pushSubscription; |
} |
-PushRegistration::PushRegistration(const String& endpoint, const String& registrationId, ServiceWorkerRegistration* serviceWorkerRegistration) |
+PushSubscription::PushSubscription(const String& endpoint, const String& subscriptionId, ServiceWorkerRegistration* serviceWorkerRegistration) |
: m_endpoint(endpoint) |
- , m_registrationId(registrationId) |
+ , m_subscriptionId(subscriptionId) |
, m_serviceWorkerRegistration(serviceWorkerRegistration) |
{ |
} |
-PushRegistration::~PushRegistration() |
+PushSubscription::~PushSubscription() |
{ |
} |
-ScriptPromise PushRegistration::unregister(ScriptState* scriptState) |
+ScriptPromise PushSubscription::unsubscribe(ScriptState* scriptState) |
{ |
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState); |
ScriptPromise promise = resolver->promise(); |
@@ -51,7 +51,7 @@ ScriptPromise PushRegistration::unregister(ScriptState* scriptState) |
return promise; |
} |
-void PushRegistration::trace(Visitor* visitor) |
+void PushSubscription::trace(Visitor* visitor) |
{ |
visitor->trace(m_serviceWorkerRegistration); |
} |