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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 2578583002: Provide a mechanism for the GCM driver to send message receipts to GCM.
Patch Set: Created 4 years 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
Index: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index bd44af2c7a28b9843ef1b504b8618534dac6cb39..278ab15f77cb50c9be92dabf92a174176f614f23 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -1344,6 +1344,8 @@ void GCMClientImpl::HandleIncomingMessage(const gcm::MCSMessage& message) {
HandleIncomingSendError(app_id, data_message_stanza, message_data);
break;
case UNKNOWN:
+ delegate_->OnMessageReceivedError(data_message_stanza.id(), app_id,
+ GCMClient::GCM_UNKNOWN_MESSAGE_TYPE);
DVLOG(1) << "Unknown message_type received. Message ignored. "
<< "App ID: " << app_id << ".";
break;
@@ -1404,10 +1406,14 @@ void GCMClientImpl::HandleIncomingDataMessage(
recorder_.RecordDataMessageReceived(app_id, sender,
data_message_stanza.ByteSize(), registered,
GCMStatsRecorder::DATA_MESSAGE);
- if (!registered)
+ if (!registered) {
+ delegate_->OnMessageReceivedError(app_id, data_message_stanza.id(),
+ GCMClient::GCM_INVALID_SUBTYPE);
Peter Beverloo 2016/12/15 19:24:24 It's a bit unfortunate that we need to do the GCMC
harkness 2016/12/21 17:23:37 I've mostly moved things to the GCMClient now. It
return;
+ }
IncomingMessage incoming_message;
+ incoming_message.id = data_message_stanza.id();
incoming_message.sender_id = data_message_stanza.from();
if (data_message_stanza.has_token())
incoming_message.collapse_key = data_message_stanza.token();

Powered by Google App Engine
This is Rietveld 408576698