| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/gcm/gcm_client_impl.h" | 5 #include "google_apis/gcm/gcm_client_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 void GCMClientImpl::SetDeviceCredentialsCallback(bool success) { | 268 void GCMClientImpl::SetDeviceCredentialsCallback(bool success) { |
| 269 // TODO(fgorski): This is one of the signals that store needs a rebuild. | 269 // TODO(fgorski): This is one of the signals that store needs a rebuild. |
| 270 DCHECK(success); | 270 DCHECK(success); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void GCMClientImpl::CheckOut() { | 273 void GCMClientImpl::CheckOut() { |
| 274 // TODO(jianli): to be implemented. | |
| 275 delegate_ = NULL; | 274 delegate_ = NULL; |
| 275 device_checkin_info_.Reset(); |
| 276 mcs_client_->Destroy(); // This will also destroy GCM store. |
| 277 mcs_client_.reset(); |
| 278 checkin_request_.reset(); |
| 279 pending_registrations_.clear(); |
| 276 } | 280 } |
| 277 | 281 |
| 278 void GCMClientImpl::Register(const std::string& app_id, | 282 void GCMClientImpl::Register(const std::string& app_id, |
| 279 const std::string& cert, | 283 const std::string& cert, |
| 280 const std::vector<std::string>& sender_ids) { | 284 const std::vector<std::string>& sender_ids) { |
| 281 DCHECK_EQ(state_, READY); | 285 DCHECK_EQ(state_, READY); |
| 282 RegistrationRequest::RequestInfo request_info( | 286 RegistrationRequest::RequestInfo request_info( |
| 283 device_checkin_info_.android_id, | 287 device_checkin_info_.android_id, |
| 284 device_checkin_info_.secret, | 288 device_checkin_info_.secret, |
| 285 app_id, | 289 app_id, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 if (iter != incoming_message.data.end()) | 450 if (iter != incoming_message.data.end()) |
| 447 message_id = iter->second; | 451 message_id = iter->second; |
| 448 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR); | 452 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR); |
| 449 } | 453 } |
| 450 | 454 |
| 451 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) { | 455 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) { |
| 452 mcs_client_ = mcs_client.Pass(); | 456 mcs_client_ = mcs_client.Pass(); |
| 453 } | 457 } |
| 454 | 458 |
| 455 } // namespace gcm | 459 } // namespace gcm |
| OLD | NEW |