| 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..013d515b6315ab9b2808a217765fc98479b11c5f 100644
|
| --- a/chrome/browser/services/gcm/gcm_profile_service.cc
|
| +++ b/chrome/browser/services/gcm/gcm_profile_service.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/services/gcm/gcm_profile_service.h"
|
|
|
| +#include <algorithm>
|
| #include <string>
|
| #include <vector>
|
|
|
| @@ -912,6 +913,16 @@ void GCMProfileService::MessageReceived(const std::string& app_id,
|
| if (username_.empty())
|
| return;
|
|
|
| + // Dropping the message when application does not have a registration entry
|
| + // or the app is not registered for the sender of the message.
|
| + RegistrationInfoMap::iterator iter = registration_info_map_.find(app_id);
|
| + if (iter == registration_info_map_.end() ||
|
| + std::find(iter->second.sender_ids.begin(),
|
| + iter->second.sender_ids.end(),
|
| + message.sender_id) == iter->second.sender_ids.end()) {
|
| + return;
|
| + }
|
| +
|
| GetEventRouter(app_id)->OnMessage(app_id, message);
|
| }
|
|
|
|
|