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

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

Issue 2436393002: Disallow repeated PushManager.subscribes with different sender ids (Closed)
Patch Set: Re-rebase on base patch 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
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 58c0d94879da52395db3924806ef57d9bb94d05e..c3539573999bb76943e68d8f3cbde6f5fba374f4 100644
--- a/content/browser/push_messaging/push_messaging_message_filter.cc
+++ b/content/browser/push_messaging/push_messaging_message_filter.cc
@@ -324,6 +324,10 @@ void PushMessagingMessageFilter::DidCheckForExistingRegistration(
SendSubscriptionError(data, PUSH_REGISTRATION_STATUS_NO_SENDER_ID);
return;
}
+ if (sender_id != stored_sender_id) {
+ SendSubscriptionError(data, PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH);
+ return;
+ }
// TODO(crbug.com/638924): Check that stored sender ID equals
harkness 2016/11/08 11:56:59 Remove the TODO now.
awdf 2016/11/08 13:21:05 oops, this crept back in, good spot. Done.
// data.options.sender_info and throw an exception if they don't match.
auto callback = base::Bind(

Powered by Google App Engine
This is Rietveld 408576698