[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 8d41e5a | 2014-05-28 03:18:49 | [diff] [blame] | 5 | #include "components/gcm_driver/fake_gcm_client.h" |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 6 | |
| 7 | #include "base/bind.h" |
| 8 | #include "base/logging.h" |
| 9 | #include "base/message_loop/message_loop.h" |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 10 | #include "base/sequenced_task_runner.h" |
jianli | 15aecc15 | 2014-10-07 03:03:53 | [diff] [blame^] | 11 | #include "base/strings/string_number_conversions.h" |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 12 | #include "base/sys_byteorder.h" |
| 13 | #include "base/time/time.h" |
[email protected] | 446f73c2 | 2014-05-14 20:47:18 | [diff] [blame] | 14 | #include "google_apis/gcm/base/encryptor.h" |
fgorski | d578c18b | 2014-09-24 23:40:17 | [diff] [blame] | 15 | #include "google_apis/gcm/engine/account_mapping.h" |
[email protected] | fc6078a | 2014-06-14 08:28:43 | [diff] [blame] | 16 | #include "net/base/ip_endpoint.h" |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 17 | |
| 18 | namespace gcm { |
| 19 | |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 20 | FakeGCMClient::FakeGCMClient( |
| 21 | StartMode start_mode, |
| 22 | const scoped_refptr<base::SequencedTaskRunner>& ui_thread, |
| 23 | const scoped_refptr<base::SequencedTaskRunner>& io_thread) |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 24 | : delegate_(NULL), |
jianli | 15aecc15 | 2014-10-07 03:03:53 | [diff] [blame^] | 25 | sequence_id_(0), |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 26 | status_(UNINITIALIZED), |
[email protected] | fc767e4 | 2014-05-13 05:02:14 | [diff] [blame] | 27 | start_mode_(start_mode), |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 28 | ui_thread_(ui_thread), |
| 29 | io_thread_(io_thread), |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 30 | weak_ptr_factory_(this) { |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 31 | } |
| 32 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 33 | FakeGCMClient::~FakeGCMClient() { |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 34 | } |
| 35 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 36 | void FakeGCMClient::Initialize( |
[email protected] | 8ad8051 | 2014-05-23 09:40:47 | [diff] [blame] | 37 | const ChromeBuildInfo& chrome_build_info, |
[email protected] | e2a4a801 | 2014-02-07 22:32:52 | [diff] [blame] | 38 | const base::FilePath& store_path, |
| 39 | const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
| 40 | const scoped_refptr<net::URLRequestContextGetter>& |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 41 | url_request_context_getter, |
[email protected] | 446f73c2 | 2014-05-14 20:47:18 | [diff] [blame] | 42 | scoped_ptr<Encryptor> encryptor, |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 43 | Delegate* delegate) { |
| 44 | delegate_ = delegate; |
[email protected] | e2a4a801 | 2014-02-07 22:32:52 | [diff] [blame] | 45 | } |
| 46 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 47 | void FakeGCMClient::Start() { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 48 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | fc767e4 | 2014-05-13 05:02:14 | [diff] [blame] | 49 | DCHECK_NE(STARTED, status_); |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 50 | |
[email protected] | fc767e4 | 2014-05-13 05:02:14 | [diff] [blame] | 51 | if (start_mode_ == DELAY_START) |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 52 | return; |
| 53 | DoLoading(); |
| 54 | } |
| 55 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 56 | void FakeGCMClient::DoLoading() { |
[email protected] | fc767e4 | 2014-05-13 05:02:14 | [diff] [blame] | 57 | status_ = STARTED; |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 58 | base::MessageLoop::current()->PostTask( |
| 59 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 60 | base::Bind(&FakeGCMClient::CheckinFinished, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 61 | weak_ptr_factory_.GetWeakPtr())); |
| 62 | } |
| 63 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 64 | void FakeGCMClient::Stop() { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 65 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | 21fee548 | 2014-03-05 00:57:15 | [diff] [blame] | 66 | status_ = STOPPED; |
[email protected] | fc6078a | 2014-06-14 08:28:43 | [diff] [blame] | 67 | delegate_->OnDisconnected(); |
[email protected] | 21fee548 | 2014-03-05 00:57:15 | [diff] [blame] | 68 | } |
| 69 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 70 | void FakeGCMClient::CheckOut() { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 71 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 72 | status_ = CHECKED_OUT; |
jianli | 15aecc15 | 2014-10-07 03:03:53 | [diff] [blame^] | 73 | sequence_id_++; |
[email protected] | 1b1c3cd | 2013-12-17 18:40:04 | [diff] [blame] | 74 | } |
| 75 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 76 | void FakeGCMClient::Register(const std::string& app_id, |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 77 | const std::vector<std::string>& sender_ids) { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 78 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 79 | |
[email protected] | 2ac4673 | 2014-04-03 23:14:31 | [diff] [blame] | 80 | std::string registration_id = GetRegistrationIdFromSenderIds(sender_ids); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 81 | base::MessageLoop::current()->PostTask( |
| 82 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 83 | base::Bind(&FakeGCMClient::RegisterFinished, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 84 | weak_ptr_factory_.GetWeakPtr(), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 85 | app_id, |
| 86 | registration_id)); |
| 87 | } |
| 88 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 89 | void FakeGCMClient::Unregister(const std::string& app_id) { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 90 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | 0e88e1d1 | 2014-03-19 06:53:08 | [diff] [blame] | 91 | |
| 92 | base::MessageLoop::current()->PostTask( |
| 93 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 94 | base::Bind(&FakeGCMClient::UnregisterFinished, |
[email protected] | 0e88e1d1 | 2014-03-19 06:53:08 | [diff] [blame] | 95 | weak_ptr_factory_.GetWeakPtr(), |
| 96 | app_id)); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 97 | } |
| 98 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 99 | void FakeGCMClient::Send(const std::string& app_id, |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 100 | const std::string& receiver_id, |
| 101 | const OutgoingMessage& message) { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 102 | DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 103 | |
| 104 | base::MessageLoop::current()->PostTask( |
| 105 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 106 | base::Bind(&FakeGCMClient::SendFinished, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 107 | weak_ptr_factory_.GetWeakPtr(), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 108 | app_id, |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 109 | message)); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 110 | } |
| 111 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 112 | void FakeGCMClient::SetRecording(bool recording) { |
[email protected] | 436bcb8 | 2014-04-18 00:40:57 | [diff] [blame] | 113 | } |
| 114 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 115 | void FakeGCMClient::ClearActivityLogs() { |
[email protected] | 436bcb8 | 2014-04-18 00:40:57 | [diff] [blame] | 116 | } |
| 117 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 118 | GCMClient::GCMStatistics FakeGCMClient::GetStatistics() const { |
[email protected] | 3560181 | 2014-03-07 19:52:43 | [diff] [blame] | 119 | return GCMClient::GCMStatistics(); |
| 120 | } |
| 121 | |
fgorski | 58b9dfc | 2014-09-29 16:46:18 | [diff] [blame] | 122 | void FakeGCMClient::SetAccountTokens( |
| 123 | const std::vector<AccountTokenInfo>& account_tokens) { |
[email protected] | 7df5ef2 | 2014-07-17 07:35:58 | [diff] [blame] | 124 | } |
| 125 | |
[email protected] | 72d4f25 | 2014-08-20 22:34:28 | [diff] [blame] | 126 | void FakeGCMClient::UpdateAccountMapping( |
| 127 | const AccountMapping& account_mapping) { |
| 128 | } |
| 129 | |
| 130 | void FakeGCMClient::RemoveAccountMapping(const std::string& account_id) { |
| 131 | } |
| 132 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 133 | void FakeGCMClient::PerformDelayedLoading() { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 134 | DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 135 | |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 136 | io_thread_->PostTask( |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 137 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 138 | base::Bind(&FakeGCMClient::DoLoading, weak_ptr_factory_.GetWeakPtr())); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 139 | } |
| 140 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 141 | void FakeGCMClient::ReceiveMessage(const std::string& app_id, |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 142 | const IncomingMessage& message) { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 143 | DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 144 | |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 145 | io_thread_->PostTask( |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 146 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 147 | base::Bind(&FakeGCMClient::MessageReceived, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 148 | weak_ptr_factory_.GetWeakPtr(), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 149 | app_id, |
| 150 | message)); |
| 151 | } |
| 152 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 153 | void FakeGCMClient::DeleteMessages(const std::string& app_id) { |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 154 | DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 155 | |
[email protected] | 1795df51a | 2014-05-22 20:18:04 | [diff] [blame] | 156 | io_thread_->PostTask( |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 157 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 158 | base::Bind(&FakeGCMClient::MessagesDeleted, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 159 | weak_ptr_factory_.GetWeakPtr(), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 160 | app_id)); |
| 161 | } |
| 162 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 163 | std::string FakeGCMClient::GetRegistrationIdFromSenderIds( |
jianli | 15aecc15 | 2014-10-07 03:03:53 | [diff] [blame^] | 164 | const std::vector<std::string>& sender_ids) const { |
[email protected] | df84c53 | 2014-04-25 15:36:54 | [diff] [blame] | 165 | // GCMService normalizes the sender IDs by making them sorted. |
[email protected] | c7f7b53 | 2014-01-24 07:24:45 | [diff] [blame] | 166 | std::vector<std::string> normalized_sender_ids = sender_ids; |
| 167 | std::sort(normalized_sender_ids.begin(), normalized_sender_ids.end()); |
| 168 | |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 169 | // Simulate the registration_id by concaternating all sender IDs. |
| 170 | // Set registration_id to empty to denote an error if sender_ids contains a |
| 171 | // hint. |
| 172 | std::string registration_id; |
| 173 | if (sender_ids.size() != 1 || |
| 174 | sender_ids[0].find("error") == std::string::npos) { |
[email protected] | c7f7b53 | 2014-01-24 07:24:45 | [diff] [blame] | 175 | for (size_t i = 0; i < normalized_sender_ids.size(); ++i) { |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 176 | if (i > 0) |
| 177 | registration_id += ","; |
[email protected] | c7f7b53 | 2014-01-24 07:24:45 | [diff] [blame] | 178 | registration_id += normalized_sender_ids[i]; |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 179 | } |
jianli | 15aecc15 | 2014-10-07 03:03:53 | [diff] [blame^] | 180 | registration_id += base::IntToString(sequence_id_); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 181 | } |
| 182 | return registration_id; |
| 183 | } |
| 184 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 185 | void FakeGCMClient::CheckinFinished() { |
fgorski | d578c18b | 2014-09-24 23:40:17 | [diff] [blame] | 186 | delegate_->OnGCMReady(std::vector<AccountMapping>()); |
[email protected] | fc6078a | 2014-06-14 08:28:43 | [diff] [blame] | 187 | delegate_->OnConnected(net::IPEndPoint()); |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 188 | } |
| 189 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 190 | void FakeGCMClient::RegisterFinished(const std::string& app_id, |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 191 | const std::string& registrion_id) { |
| 192 | delegate_->OnRegisterFinished( |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 193 | app_id, registrion_id, registrion_id.empty() ? SERVER_ERROR : SUCCESS); |
| 194 | } |
| 195 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 196 | void FakeGCMClient::UnregisterFinished(const std::string& app_id) { |
[email protected] | 0e88e1d1 | 2014-03-19 06:53:08 | [diff] [blame] | 197 | delegate_->OnUnregisterFinished(app_id, GCMClient::SUCCESS); |
| 198 | } |
| 199 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 200 | void FakeGCMClient::SendFinished(const std::string& app_id, |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 201 | const OutgoingMessage& message) { |
| 202 | delegate_->OnSendFinished(app_id, message.id, SUCCESS); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 203 | |
| 204 | // Simulate send error if message id contains a hint. |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 205 | if (message.id.find("error") != std::string::npos) { |
| 206 | SendErrorDetails send_error_details; |
| 207 | send_error_details.message_id = message.id; |
| 208 | send_error_details.result = NETWORK_ERROR; |
| 209 | send_error_details.additional_data = message.data; |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 210 | base::MessageLoop::current()->PostDelayedTask( |
| 211 | FROM_HERE, |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 212 | base::Bind(&FakeGCMClient::MessageSendError, |
[email protected] | d3a4b2e | 2014-02-27 13:46:54 | [diff] [blame] | 213 | weak_ptr_factory_.GetWeakPtr(), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 214 | app_id, |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 215 | send_error_details), |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 216 | base::TimeDelta::FromMilliseconds(200)); |
[email protected] | 292af2b2 | 2014-08-06 19:42:45 | [diff] [blame] | 217 | } else if(message.id.find("ack") != std::string::npos) { |
| 218 | base::MessageLoop::current()->PostDelayedTask( |
| 219 | FROM_HERE, |
| 220 | base::Bind(&FakeGCMClient::SendAcknowledgement, |
| 221 | weak_ptr_factory_.GetWeakPtr(), |
| 222 | app_id, |
| 223 | message.id), |
| 224 | base::TimeDelta::FromMilliseconds(200)); |
| 225 | |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 226 | } |
| 227 | } |
| 228 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 229 | void FakeGCMClient::MessageReceived(const std::string& app_id, |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 230 | const IncomingMessage& message) { |
| 231 | if (delegate_) |
| 232 | delegate_->OnMessageReceived(app_id, message); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 233 | } |
| 234 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 235 | void FakeGCMClient::MessagesDeleted(const std::string& app_id) { |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 236 | if (delegate_) |
| 237 | delegate_->OnMessagesDeleted(app_id); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 238 | } |
| 239 | |
[email protected] | accbbc9 | 2014-05-15 21:28:59 | [diff] [blame] | 240 | void FakeGCMClient::MessageSendError( |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 241 | const std::string& app_id, |
| 242 | const GCMClient::SendErrorDetails& send_error_details) { |
[email protected] | 5799d05 | 2014-02-12 20:47:39 | [diff] [blame] | 243 | if (delegate_) |
[email protected] | c6fe36b | 2014-03-11 10:58:12 | [diff] [blame] | 244 | delegate_->OnMessageSendError(app_id, send_error_details); |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 245 | } |
| 246 | |
[email protected] | 292af2b2 | 2014-08-06 19:42:45 | [diff] [blame] | 247 | void FakeGCMClient::SendAcknowledgement(const std::string& app_id, |
| 248 | const std::string& message_id) { |
| 249 | if (delegate_) |
| 250 | delegate_->OnSendAcknowledged(app_id, message_id); |
| 251 | } |
| 252 | |
[email protected] | b16a7c5 | 2013-11-20 01:18:59 | [diff] [blame] | 253 | } // namespace gcm |