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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 185933003: [GCM] Only allow the senders that the application is currently registered for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index ec5e0950cc02ee42b535cd77b0027c1cc6fb15f9..a0a9a56ad2fe4e981faeb8f6b35001059d17f79e 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -906,6 +906,12 @@ void GCMProfileService::MessageReceived(const std::string& app_id,
if (username_.empty())
return;
+ RegistrationInfoMap::iterator iter = registration_info_map_.find(app_id);
+ if (iter == registration_info_map_.end() ||
+ iter->second.sender_id != message.sender_id) {
+ return;
+ }
+
GetEventRouter(app_id)->OnMessage(app_id, message);
}
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698