| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 device_checkin_info_.android_id, | 298 device_checkin_info_.android_id, |
| 299 device_checkin_info_.secret, | 299 device_checkin_info_.secret, |
| 300 std::string(), | 300 std::string(), |
| 301 account_ids_, | 301 account_ids_, |
| 302 chrome_build_proto_); | 302 chrome_build_proto_); |
| 303 checkin_request_.reset( | 303 checkin_request_.reset( |
| 304 new CheckinRequest(request_info, | 304 new CheckinRequest(request_info, |
| 305 kDefaultBackoffPolicy, | 305 kDefaultBackoffPolicy, |
| 306 base::Bind(&GCMClientImpl::OnCheckinCompleted, | 306 base::Bind(&GCMClientImpl::OnCheckinCompleted, |
| 307 weak_ptr_factory_.GetWeakPtr()), | 307 weak_ptr_factory_.GetWeakPtr()), |
| 308 url_request_context_getter_)); | 308 url_request_context_getter_, |
| 309 &recorder_)); |
| 309 checkin_request_->Start(); | 310 checkin_request_->Start(); |
| 310 } | 311 } |
| 311 | 312 |
| 312 void GCMClientImpl::OnCheckinCompleted( | 313 void GCMClientImpl::OnCheckinCompleted( |
| 313 const checkin_proto::AndroidCheckinResponse& checkin_response) { | 314 const checkin_proto::AndroidCheckinResponse& checkin_response) { |
| 314 checkin_request_.reset(); | 315 checkin_request_.reset(); |
| 315 | 316 |
| 316 if (!checkin_response.has_android_id() || | 317 if (!checkin_response.has_android_id() || |
| 317 !checkin_response.has_security_token()) { | 318 !checkin_response.has_security_token()) { |
| 318 // TODO(fgorski): I don't think a retry here will help, we should probably | 319 // TODO(fgorski): I don't think a retry here will help, we should probably |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 | 735 |
| 735 recorder_.RecordIncomingSendError( | 736 recorder_.RecordIncomingSendError( |
| 736 data_message_stanza.category(), | 737 data_message_stanza.category(), |
| 737 data_message_stanza.to(), | 738 data_message_stanza.to(), |
| 738 data_message_stanza.id()); | 739 data_message_stanza.id()); |
| 739 delegate_->OnMessageSendError(data_message_stanza.category(), | 740 delegate_->OnMessageSendError(data_message_stanza.category(), |
| 740 send_error_details); | 741 send_error_details); |
| 741 } | 742 } |
| 742 | 743 |
| 743 } // namespace gcm | 744 } // namespace gcm |
| OLD | NEW |