Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: google_apis/gcm/tools/mcs_probe.cc

Issue 261573002: Add checkin activity recording to gcm recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 checkin_proto::ChromeBuildProto::CHANNEL_CANARY); 429 checkin_proto::ChromeBuildProto::CHANNEL_CANARY);
430 chrome_build_proto.set_chrome_version(kChromeVersion); 430 chrome_build_proto.set_chrome_version(kChromeVersion);
431 431
432 CheckinRequest::RequestInfo request_info( 432 CheckinRequest::RequestInfo request_info(
433 0, 0, std::string(), std::vector<std::string>(), chrome_build_proto); 433 0, 0, std::string(), std::vector<std::string>(), chrome_build_proto);
434 434
435 checkin_request_.reset(new CheckinRequest( 435 checkin_request_.reset(new CheckinRequest(
436 request_info, 436 request_info,
437 kDefaultBackoffPolicy, 437 kDefaultBackoffPolicy,
438 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)), 438 base::Bind(&MCSProbe::OnCheckInCompleted, base::Unretained(this)),
439 url_request_context_getter_.get())); 439 url_request_context_getter_.get(),
440 &recorder_));
440 checkin_request_->Start(); 441 checkin_request_->Start();
441 } 442 }
442 443
443 void MCSProbe::OnCheckInCompleted( 444 void MCSProbe::OnCheckInCompleted(
444 const checkin_proto::AndroidCheckinResponse& checkin_response) { 445 const checkin_proto::AndroidCheckinResponse& checkin_response) {
445 bool success = checkin_response.has_android_id() && 446 bool success = checkin_response.has_android_id() &&
446 checkin_response.android_id() != 0UL && 447 checkin_response.android_id() != 0UL &&
447 checkin_response.has_security_token() && 448 checkin_response.has_security_token() &&
448 checkin_response.security_token() != 0UL; 449 checkin_response.security_token() != 0UL;
449 LOG(INFO) << "Check-in request completion " 450 LOG(INFO) << "Check-in request completion "
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 495
495 return 0; 496 return 0;
496 } 497 }
497 498
498 } // namespace 499 } // namespace
499 } // namespace gcm 500 } // namespace gcm
500 501
501 int main(int argc, char* argv[]) { 502 int main(int argc, char* argv[]) {
502 return gcm::MCSProbeMain(argc, argv); 503 return gcm::MCSProbeMain(argc, argv);
503 } 504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698