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 eaa66c894d182fea831ea919e8b275cdc9edd992..88447c6f21bc4f09b2bffc83b15cfd9823db0408 100644 |
--- a/components/gcm_driver/fake_gcm_client.cc |
+++ b/components/gcm_driver/fake_gcm_client.cc |
@@ -238,15 +238,28 @@ void FakeGCMClient::PerformDelayedStart() { |
} |
void FakeGCMClient::ReceiveMessage(const std::string& app_id, |
+ const std::string& message_id, |
const IncomingMessage& message) { |
DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
+ MessageReceiptCallback optional_receipt_callback = |
+ base::Bind(&FakeGCMClient::SendMessageReceipt, |
+ weak_ptr_factory_.GetWeakPtr(), message_id, app_id); |
+ |
io_thread_->PostTask( |
- FROM_HERE, |
- base::Bind(&FakeGCMClient::MessageReceived, |
- weak_ptr_factory_.GetWeakPtr(), |
- app_id, |
- message)); |
+ FROM_HERE, base::Bind(&FakeGCMClient::MessageReceived, |
+ weak_ptr_factory_.GetWeakPtr(), app_id, message, |
+ optional_receipt_callback)); |
+} |
+ |
+void FakeGCMClient::SendMessageReceipt(const std::string& message_id, |
+ const std::string& app_id, |
+ GCMMessageStatus status) { |
+ DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
+ |
+ receipt_message_id_ = message_id; |
+ receipt_app_id_ = app_id; |
+ receipt_status_ = status; |
} |
void FakeGCMClient::DeleteMessages(const std::string& app_id) { |
@@ -302,10 +315,12 @@ void FakeGCMClient::SendFinished(const std::string& app_id, |
} |
} |
-void FakeGCMClient::MessageReceived(const std::string& app_id, |
- const IncomingMessage& message) { |
+void FakeGCMClient::MessageReceived( |
+ const std::string& app_id, |
+ const IncomingMessage& message, |
+ const MessageReceiptCallback& optional_receipt_callback) { |
if (delegate_) |
- delegate_->OnMessageReceived(app_id, message); |
+ delegate_->OnMessageReceived(app_id, message, optional_receipt_callback); |
} |
void FakeGCMClient::MessagesDeleted(const std::string& app_id) { |