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

Unified Diff: content/browser/push_messaging/push_messaging_message_filter.cc

Issue 2436393002: Disallow repeated PushManager.subscribes with different sender ids (Closed)
Patch Set: Make error message more informative Created 4 years, 1 month 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
« no previous file with comments | « chrome/test/data/push_messaging/service_worker.js ('k') | content/child/push_messaging/push_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/push_messaging/push_messaging_message_filter.cc
diff --git a/content/browser/push_messaging/push_messaging_message_filter.cc b/content/browser/push_messaging/push_messaging_message_filter.cc
index 44347dd1508350e510820a2e241a71d732bd5cc9..9820f4f151d95be74ca3f6e4ad5b6fc6a80158dc 100644
--- a/content/browser/push_messaging/push_messaging_message_filter.cc
+++ b/content/browser/push_messaging/push_messaging_message_filter.cc
@@ -324,8 +324,10 @@ void PushMessagingMessageFilter::DidCheckForExistingRegistration(
SendSubscriptionError(data, PUSH_REGISTRATION_STATUS_NO_SENDER_ID);
return;
}
- // TODO(crbug.com/638924): Check that stored sender ID equals
- // data.options.sender_info and throw an exception if they don't match.
+ if (fixed_sender_id != stored_sender_id) {
+ SendSubscriptionError(data, PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH);
+ return;
+ }
auto callback = base::Bind(
&PushMessagingMessageFilter::DidGetEncryptionKeys,
weak_factory_io_to_io_.GetWeakPtr(), data, push_registration_id);
« no previous file with comments | « chrome/test/data/push_messaging/service_worker.js ('k') | content/child/push_messaging/push_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698