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

Side by Side Diff: content/renderer/push_messaging/push_messaging_dispatcher.cc

Issue 1944863002: Push API: Fix stored sender ID being out of sync with registration ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ii7swdb
Patch Set: Add TODO Created 4 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 unified diff | Download patch
« no previous file with comments | « content/common/push_messaging_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" 5 #include "content/renderer/push_messaging/push_messaging_dispatcher.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/child/service_worker/web_service_worker_registration_impl.h" 9 #include "content/child/service_worker/web_service_worker_registration_impl.h"
10 #include "content/common/push_messaging_messages.h" 10 #include "content/common/push_messaging_messages.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int64_t service_worker_registration_id = 95 int64_t service_worker_registration_id =
96 static_cast<WebServiceWorkerRegistrationImpl*>( 96 static_cast<WebServiceWorkerRegistrationImpl*>(
97 service_worker_registration) 97 service_worker_registration)
98 ->registration_id(); 98 ->registration_id();
99 99
100 if (options.sender_info.empty()) { 100 if (options.sender_info.empty()) {
101 OnSubscribeFromDocumentError(request_id, 101 OnSubscribeFromDocumentError(request_id,
102 PUSH_REGISTRATION_STATUS_NO_SENDER_ID); 102 PUSH_REGISTRATION_STATUS_NO_SENDER_ID);
103 return; 103 return;
104 } 104 }
105 Send(new PushMessagingHostMsg_SubscribeFromDocument( 105 Send(new PushMessagingHostMsg_Subscribe(
106 routing_id(), request_id, options, service_worker_registration_id)); 106 routing_id(), request_id, service_worker_registration_id, options));
107 } 107 }
108 108
109 void PushMessagingDispatcher::OnSubscribeFromDocumentSuccess( 109 void PushMessagingDispatcher::OnSubscribeFromDocumentSuccess(
110 int32_t request_id, 110 int32_t request_id,
111 const GURL& endpoint, 111 const GURL& endpoint,
112 const std::vector<uint8_t>& p256dh, 112 const std::vector<uint8_t>& p256dh,
113 const std::vector<uint8_t>& auth) { 113 const std::vector<uint8_t>& auth) {
114 blink::WebPushSubscriptionCallbacks* callbacks = 114 blink::WebPushSubscriptionCallbacks* callbacks =
115 subscription_callbacks_.Lookup(request_id); 115 subscription_callbacks_.Lookup(request_id);
116 DCHECK(callbacks); 116 DCHECK(callbacks);
(...skipping 17 matching lines...) Expand all
134 : blink::WebPushError::ErrorTypeAbort; 134 : blink::WebPushError::ErrorTypeAbort;
135 135
136 callbacks->onError(blink::WebPushError( 136 callbacks->onError(blink::WebPushError(
137 error_type, 137 error_type,
138 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); 138 blink::WebString::fromUTF8(PushRegistrationStatusToString(status))));
139 139
140 subscription_callbacks_.Remove(request_id); 140 subscription_callbacks_.Remove(request_id);
141 } 141 }
142 142
143 } // namespace content 143 } // namespace content
OLDNEW
« no previous file with comments | « content/common/push_messaging_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698