| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/gcm_driver/fake_gcm_client.h" | 5 #include "components/gcm_driver/fake_gcm_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 const std::string& instance_id_data) { | 141 const std::string& instance_id_data) { |
| 142 } | 142 } |
| 143 | 143 |
| 144 void FakeGCMClient::RemoveInstanceIDData(const std::string& app_id) { | 144 void FakeGCMClient::RemoveInstanceIDData(const std::string& app_id) { |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::string FakeGCMClient::GetInstanceIDData(const std::string& app_id) { | 147 std::string FakeGCMClient::GetInstanceIDData(const std::string& app_id) { |
| 148 return std::string(); | 148 return std::string(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void FakeGCMClient::AddHeartbeatInterval(const std::string& scope, |
| 152 int interval_ms) { |
| 153 } |
| 154 |
| 155 void FakeGCMClient::RemoveHeartbeatInterval(const std::string& scope) { |
| 156 } |
| 157 |
| 151 void FakeGCMClient::PerformDelayedStart() { | 158 void FakeGCMClient::PerformDelayedStart() { |
| 152 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); | 159 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
| 153 | 160 |
| 154 io_thread_->PostTask( | 161 io_thread_->PostTask( |
| 155 FROM_HERE, | 162 FROM_HERE, |
| 156 base::Bind(&FakeGCMClient::DoStart, weak_ptr_factory_.GetWeakPtr())); | 163 base::Bind(&FakeGCMClient::DoStart, weak_ptr_factory_.GetWeakPtr())); |
| 157 } | 164 } |
| 158 | 165 |
| 159 void FakeGCMClient::ReceiveMessage(const std::string& app_id, | 166 void FakeGCMClient::ReceiveMessage(const std::string& app_id, |
| 160 const IncomingMessage& message) { | 167 const IncomingMessage& message) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 delegate_->OnMessageSendError(app_id, send_error_details); | 268 delegate_->OnMessageSendError(app_id, send_error_details); |
| 262 } | 269 } |
| 263 | 270 |
| 264 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, | 271 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, |
| 265 const std::string& message_id) { | 272 const std::string& message_id) { |
| 266 if (delegate_) | 273 if (delegate_) |
| 267 delegate_->OnSendAcknowledged(app_id, message_id); | 274 delegate_->OnSendAcknowledged(app_id, message_id); |
| 268 } | 275 } |
| 269 | 276 |
| 270 } // namespace gcm | 277 } // namespace gcm |
| OLD | NEW |