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

Unified Diff: Source/modules/push_messaging/PushSubscription.cpp

Issue 841333002: Push API: rename registration to subscription. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use https in the spec link. Created 5 years, 11 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/push_messaging/PushSubscription.cpp
diff --git a/Source/modules/push_messaging/PushRegistration.cpp b/Source/modules/push_messaging/PushSubscription.cpp
similarity index 57%
rename from Source/modules/push_messaging/PushRegistration.cpp
rename to Source/modules/push_messaging/PushSubscription.cpp
index 7c85f95454eda63221717c44189bebf1c499ec90..6d0fbdf9cd82f4823af30e3689c70c6b429197cd 100644
--- a/Source/modules/push_messaging/PushRegistration.cpp
+++ b/Source/modules/push_messaging/PushSubscription.cpp
@@ -3,7 +3,7 @@
// 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);
}
« no previous file with comments | « Source/modules/push_messaging/PushSubscription.h ('k') | Source/modules/push_messaging/PushSubscription.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698