| 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 // A standalone tool for testing MCS connections and the MCS client on their | 5 // A standalone tool for testing MCS connections and the MCS client on their |
| 6 // own. | 6 // own. |
| 7 | 7 |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <cstdio> | 9 #include <cstdio> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 chrome_build_proto.set_chrome_version(kChromeVersion); | 431 chrome_build_proto.set_chrome_version(kChromeVersion); |
| 432 | 432 |
| 433 CheckinRequest::RequestInfo request_info( | 433 CheckinRequest::RequestInfo request_info( |
| 434 0, 0, std::string(), std::vector<std::string>(), chrome_build_proto); | 434 0, 0, std::string(), std::vector<std::string>(), chrome_build_proto); |
| 435 | 435 |
| 436 checkin_request_.reset(new CheckinRequest( | 436 checkin_request_.reset(new CheckinRequest( |
| 437 GServicesSettings(gcm_store_.get()).checkin_url(), | 437 GServicesSettings(gcm_store_.get()).checkin_url(), |
| 438 request_info, | 438 request_info, |
| 439 kDefaultBackoffPolicy, | 439 kDefaultBackoffPolicy, |
| 440 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)), | 440 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)), |
| 441 url_request_context_getter_.get())); | 441 url_request_context_getter_.get(), |
| 442 &recorder_)); |
| 442 checkin_request_->Start(); | 443 checkin_request_->Start(); |
| 443 } | 444 } |
| 444 | 445 |
| 445 void MCSProbe::OnCheckInCompleted( | 446 void MCSProbe::OnCheckInCompleted( |
| 446 const checkin_proto::AndroidCheckinResponse& checkin_response) { | 447 const checkin_proto::AndroidCheckinResponse& checkin_response) { |
| 447 bool success = checkin_response.has_android_id() && | 448 bool success = checkin_response.has_android_id() && |
| 448 checkin_response.android_id() != 0UL && | 449 checkin_response.android_id() != 0UL && |
| 449 checkin_response.has_security_token() && | 450 checkin_response.has_security_token() && |
| 450 checkin_response.security_token() != 0UL; | 451 checkin_response.security_token() != 0UL; |
| 451 LOG(INFO) << "Check-in request completion " | 452 LOG(INFO) << "Check-in request completion " |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 497 |
| 497 return 0; | 498 return 0; |
| 498 } | 499 } |
| 499 | 500 |
| 500 } // namespace | 501 } // namespace |
| 501 } // namespace gcm | 502 } // namespace gcm |
| 502 | 503 |
| 503 int main(int argc, char* argv[]) { | 504 int main(int argc, char* argv[]) { |
| 504 return gcm::MCSProbeMain(argc, argv); | 505 return gcm::MCSProbeMain(argc, argv); |
| 505 } | 506 } |
| OLD | NEW |