Chromium Code Reviews| 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 c215192c8df17f593250d6d4f9d6306a0d3b5f73..c1fc24c655194bc3960f612943805c3222deb1ff 100644 |
| --- a/chrome/browser/services/gcm/gcm_profile_service.cc |
| +++ b/chrome/browser/services/gcm/gcm_profile_service.cc |
| @@ -912,7 +912,19 @@ void GCMProfileService::MessageReceived(const std::string& app_id, |
| if (username_.empty()) |
| return; |
| - GetEventRouter(app_id)->OnMessage(app_id, message); |
| + RegistrationInfoMap::iterator info_iter = registration_info_map_.find(app_id); |
| + if (info_iter == registration_info_map_.end()) |
| + return; |
| + |
| + for (std::vector<std::string>::const_iterator iter = |
|
jianli
2014/03/05 01:33:02
nit: Please add a comment like:
// Drop the mess
fgorski
2014/03/05 19:30:22
Done.
|
| + info_iter->second.sender_ids.begin(); |
| + iter != info_iter->second.sender_ids.end(); |
| + ++iter) { |
| + if (*iter == message.sender_id) { |
| + GetEventRouter(app_id)->OnMessage(app_id, message); |
| + return; |
| + } |
| + } |
| } |
| void GCMProfileService::MessagesDeleted(const std::string& app_id) { |