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

Unified Diff: components/gcm_driver/fake_gcm_client.cc

Issue 442123003: [GCM] Adding the OnSendAcknowledgement event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing code review comments. Created 6 years, 4 months 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
« no previous file with comments | « components/gcm_driver/fake_gcm_client.h ('k') | components/gcm_driver/gcm_app_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/fake_gcm_client.cc
diff --git a/components/gcm_driver/fake_gcm_client.cc b/components/gcm_driver/fake_gcm_client.cc
index 9bad08d9d7950b30c0ffa7811817912367f5cf1b..6a5639c6ae7689a35507e29d042de1b232000363 100644
--- a/components/gcm_driver/fake_gcm_client.cc
+++ b/components/gcm_driver/fake_gcm_client.cc
@@ -203,6 +203,15 @@ void FakeGCMClient::SendFinished(const std::string& app_id,
app_id,
send_error_details),
base::TimeDelta::FromMilliseconds(200));
+ } else if(message.id.find("ack") != std::string::npos) {
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&FakeGCMClient::SendAcknowledgement,
+ weak_ptr_factory_.GetWeakPtr(),
+ app_id,
+ message.id),
+ base::TimeDelta::FromMilliseconds(200));
+
}
}
@@ -224,4 +233,10 @@ void FakeGCMClient::MessageSendError(
delegate_->OnMessageSendError(app_id, send_error_details);
}
+void FakeGCMClient::SendAcknowledgement(const std::string& app_id,
+ const std::string& message_id) {
+ if (delegate_)
+ delegate_->OnSendAcknowledged(app_id, message_id);
+}
+
} // namespace gcm
« no previous file with comments | « components/gcm_driver/fake_gcm_client.h ('k') | components/gcm_driver/gcm_app_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698