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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 instance_id_token_info->authorized_entity, | 134 instance_id_token_info->authorized_entity, |
135 instance_id_token_info->scope); | 135 instance_id_token_info->scope); |
136 } | 136 } |
137 | 137 |
138 base::ThreadTaskRunnerHandle::Get()->PostTask( | 138 base::ThreadTaskRunnerHandle::Get()->PostTask( |
139 FROM_HERE, base::Bind(&FakeGCMClient::RegisterFinished, | 139 FROM_HERE, base::Bind(&FakeGCMClient::RegisterFinished, |
140 weak_ptr_factory_.GetWeakPtr(), registration_info, | 140 weak_ptr_factory_.GetWeakPtr(), registration_info, |
141 registration_id)); | 141 registration_id)); |
142 } | 142 } |
143 | 143 |
| 144 bool FakeGCMClient::ValidateRegistration( |
| 145 const linked_ptr<RegistrationInfo>& registration_info, |
| 146 const std::string& registration_id) { |
| 147 return true; |
| 148 } |
| 149 |
144 void FakeGCMClient::Unregister( | 150 void FakeGCMClient::Unregister( |
145 const linked_ptr<RegistrationInfo>& registration_info) { | 151 const linked_ptr<RegistrationInfo>& registration_info) { |
146 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 152 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
147 | 153 |
148 base::ThreadTaskRunnerHandle::Get()->PostTask( | 154 base::ThreadTaskRunnerHandle::Get()->PostTask( |
149 FROM_HERE, base::Bind(&FakeGCMClient::UnregisterFinished, | 155 FROM_HERE, base::Bind(&FakeGCMClient::UnregisterFinished, |
150 weak_ptr_factory_.GetWeakPtr(), registration_info)); | 156 weak_ptr_factory_.GetWeakPtr(), registration_info)); |
151 } | 157 } |
152 | 158 |
153 void FakeGCMClient::Send(const std::string& app_id, | 159 void FakeGCMClient::Send(const std::string& app_id, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 delegate_->OnMessageSendError(app_id, send_error_details); | 326 delegate_->OnMessageSendError(app_id, send_error_details); |
321 } | 327 } |
322 | 328 |
323 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, | 329 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, |
324 const std::string& message_id) { | 330 const std::string& message_id) { |
325 if (delegate_) | 331 if (delegate_) |
326 delegate_->OnSendAcknowledged(app_id, message_id); | 332 delegate_->OnSendAcknowledged(app_id, message_id); |
327 } | 333 } |
328 | 334 |
329 } // namespace gcm | 335 } // namespace gcm |
OLD | NEW |