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

Unified Diff: content/renderer/push_messaging/push_messaging_dispatcher.cc

Issue 1134733006: Push API: use (un)subscription instead of (un)registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed pre-submit warning Created 5 years, 7 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: content/renderer/push_messaging/push_messaging_dispatcher.cc
diff --git a/content/renderer/push_messaging/push_messaging_dispatcher.cc b/content/renderer/push_messaging/push_messaging_dispatcher.cc
index e3f838a1af4d3d55f6a211b989542cd4b5a2f677..ee30c02ace203736c74a2ccce1080cf12ebd8cb5 100644
--- a/content/renderer/push_messaging/push_messaging_dispatcher.cc
+++ b/content/renderer/push_messaging/push_messaging_dispatcher.cc
@@ -30,10 +30,10 @@ PushMessagingDispatcher::~PushMessagingDispatcher() {}
bool PushMessagingDispatcher::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PushMessagingDispatcher, message)
- IPC_MESSAGE_HANDLER(PushMessagingMsg_RegisterFromDocumentSuccess,
- OnRegisterFromDocumentSuccess)
- IPC_MESSAGE_HANDLER(PushMessagingMsg_RegisterFromDocumentError,
- OnRegisterFromDocumentError)
+ IPC_MESSAGE_HANDLER(PushMessagingMsg_SubscribeFromDocumentSuccess,
+ OnSubscribeFromDocumentSuccess)
+ IPC_MESSAGE_HANDLER(PushMessagingMsg_SubscribeFromDocumentError,
+ OnSubscribeFromDocumentError)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -69,8 +69,8 @@ void PushMessagingDispatcher::DoSubscribe(
? std::string()
: base::UTF16ToUTF8(manifest.gcm_sender_id.string());
if (sender_id.empty()) {
- OnRegisterFromDocumentError(request_id,
- PUSH_REGISTRATION_STATUS_NO_SENDER_ID);
+ OnSubscribeFromDocumentError(request_id,
+ PUSH_REGISTRATION_STATUS_NO_SENDER_ID);
return;
}
@@ -79,7 +79,7 @@ void PushMessagingDispatcher::DoSubscribe(
const bool user_visible = manifest.gcm_user_visible_only ||
options.userVisibleOnly;
- Send(new PushMessagingHostMsg_RegisterFromDocument(
+ Send(new PushMessagingHostMsg_SubscribeFromDocument(
routing_id(), request_id,
manifest.gcm_sender_id.is_null()
? std::string()
@@ -87,10 +87,10 @@ void PushMessagingDispatcher::DoSubscribe(
user_visible, service_worker_registration_id));
}
-void PushMessagingDispatcher::OnRegisterFromDocumentSuccess(
+void PushMessagingDispatcher::OnSubscribeFromDocumentSuccess(
int32_t request_id,
const GURL& endpoint,
- const std::string& registration_id) {
+ const std::string& subscription_id) {
blink::WebPushSubscriptionCallbacks* callbacks =
subscription_callbacks_.Lookup(request_id);
DCHECK(callbacks);
@@ -98,13 +98,13 @@ void PushMessagingDispatcher::OnRegisterFromDocumentSuccess(
scoped_ptr<blink::WebPushSubscription> subscription(
new blink::WebPushSubscription(
WebString::fromUTF8(endpoint.spec()),
- WebString::fromUTF8(registration_id)));
+ WebString::fromUTF8(subscription_id)));
callbacks->onSuccess(subscription.release());
subscription_callbacks_.Remove(request_id);
}
-void PushMessagingDispatcher::OnRegisterFromDocumentError(
+void PushMessagingDispatcher::OnSubscribeFromDocumentError(
int32_t request_id,
PushRegistrationStatus status) {
blink::WebPushSubscriptionCallbacks* callbacks =

Powered by Google App Engine
This is Rietveld 408576698