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> |
| 11 #include <vector> |
11 | 12 |
12 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
18 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
19 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 checkin_proto::ChromeBuildProto::PLATFORM_LINUX); | 419 checkin_proto::ChromeBuildProto::PLATFORM_LINUX); |
419 chrome_build_proto.set_channel( | 420 chrome_build_proto.set_channel( |
420 checkin_proto::ChromeBuildProto::CHANNEL_CANARY); | 421 checkin_proto::ChromeBuildProto::CHANNEL_CANARY); |
421 chrome_build_proto.set_chrome_version(kChromeVersion); | 422 chrome_build_proto.set_chrome_version(kChromeVersion); |
422 checkin_request_.reset(new CheckinRequest( | 423 checkin_request_.reset(new CheckinRequest( |
423 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)), | 424 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)), |
424 kDefaultBackoffPolicy, | 425 kDefaultBackoffPolicy, |
425 chrome_build_proto, | 426 chrome_build_proto, |
426 0, | 427 0, |
427 0, | 428 0, |
| 429 std::vector<std::string>(), |
428 url_request_context_getter_.get())); | 430 url_request_context_getter_.get())); |
429 checkin_request_->Start(); | 431 checkin_request_->Start(); |
430 } | 432 } |
431 | 433 |
432 void MCSProbe::OnCheckInCompleted(uint64 android_id, uint64 secret) { | 434 void MCSProbe::OnCheckInCompleted(uint64 android_id, uint64 secret) { |
433 LOG(INFO) << "Check-in request completion " | 435 LOG(INFO) << "Check-in request completion " |
434 << (android_id ? "success!" : "failure!"); | 436 << (android_id ? "success!" : "failure!"); |
435 if (!android_id || !secret) | 437 if (!android_id || !secret) |
436 return; | 438 return; |
437 android_id_ = android_id; | 439 android_id_ = android_id; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 478 |
477 return 0; | 479 return 0; |
478 } | 480 } |
479 | 481 |
480 } // namespace | 482 } // namespace |
481 } // namespace gcm | 483 } // namespace gcm |
482 | 484 |
483 int main(int argc, char* argv[]) { | 485 int main(int argc, char* argv[]) { |
484 return gcm::MCSProbeMain(argc, argv); | 486 return gcm::MCSProbeMain(argc, argv); |
485 } | 487 } |
OLD | NEW |