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 3da8d112669f7559cc281453788fe17ce29166a9..e37f23b0ba0b46d93d1cd7231234fbd7058cee0a 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.size(); |
johnme
2015/07/21 13:52:20
Remove the .size()
Peter Beverloo
2015/08/03 18:55:34
Done.
|
content::BrowserContext::DeliverPushMessage( |
profile_, |