| Index: chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| index 10cb6bb7a8dd628f52a99d648433fdfb95ddd44f..7b4d9dda11bd212e16234d66ccdbf0322d9abd0a 100644
|
| --- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| +++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| @@ -194,28 +194,9 @@ void PushMessagingServiceImpl::OnMessage(const std::string& app_id,
|
| "PushMessaging.MessageReceived.Origin",
|
| app_identifier.origin());
|
|
|
| - // The Push API only exposes a single string of data in the push event fired
|
| - // on the Service Worker. When developers send messages using GCM to the Push
|
| - // API and want to include a message payload, they must pass a single key-
|
| - // value pair, where the key is "data" and the value is the string they want
|
| - // to be passed to their Service Worker. For example, they could send the
|
| - // following JSON using the HTTPS GCM API:
|
| - // {
|
| - // "registration_ids": ["FOO", "BAR"],
|
| - // "data": {
|
| - // "data": "BAZ",
|
| - // },
|
| - // "delay_while_idle": true,
|
| - // }
|
| - // TODO(johnme): Make sure this is clearly documented for developers.
|
| std::string data;
|
| - // TODO(peter): Message payloads are disabled pending mandatory encryption.
|
| - // https://crbug.com/449184
|
| - if (AreMessagePayloadsEnabled()) {
|
| - gcm::MessageData::const_iterator it = message.data.find("data");
|
| - if (it != message.data.end())
|
| - data = it->second;
|
| - }
|
| + if (AreMessagePayloadsEnabled() && message.raw_data.size())
|
| + data = message.raw_data;
|
|
|
| content::BrowserContext::DeliverPushMessage(
|
| profile_,
|
|
|