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

Side by Side Diff: google_apis/gaia/gaia_auth_fetcher.cc

Issue 2697563002: Pass time since profile was loaded and request count on each ListAccount request to Gaia. (Closed)
Patch Set: Nit Created 3 years, 10 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
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gaia/gaia_auth_fetcher.h" 5 #include "google_apis/gaia/gaia_auth_fetcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 const std::string& service) { 642 const std::string& service) {
643 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; 643 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
644 644
645 request_body_ = MakeOAuthLoginBody(service, source_); 645 request_body_ = MakeOAuthLoginBody(service, source_);
646 std::string authentication_header = 646 std::string authentication_header =
647 base::StringPrintf(kOAuth2BearerHeaderFormat, access_token.c_str()); 647 base::StringPrintf(kOAuth2BearerHeaderFormat, access_token.c_str());
648 CreateAndStartGaiaFetcher(request_body_, authentication_header, 648 CreateAndStartGaiaFetcher(request_body_, authentication_header,
649 oauth_login_gurl_, net::LOAD_NORMAL); 649 oauth_login_gurl_, net::LOAD_NORMAL);
650 } 650 }
651 651
652 void GaiaAuthFetcher::StartListAccounts() { 652 void GaiaAuthFetcher::StartListAccounts(const base::Time& profile_load_time) {
653 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; 653 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
654 654
655 // Report the time since the profile was loaded and the number of this request
656 // in order to debug channel ID issues observed on Gaia.
657 static int32_t list_accounts_request_counter = 0;
658 std::string extra_headers = base::StringPrintf(
659 "Origin: %s \r\n RequestCount: %d \r\n TimeSinceProfileLoad: %ld",
660 "https://www.google.com", list_accounts_request_counter++,
661 (base::Time::Now() - profile_load_time).InMilliseconds());
655 CreateAndStartGaiaFetcher(" ", // To force an HTTP POST. 662 CreateAndStartGaiaFetcher(" ", // To force an HTTP POST.
656 "Origin: https://www.google.com", 663 extra_headers, list_accounts_gurl_,
vanupam 2017/02/15 03:08:28 list_accounts_gurl_ is assigned in the constructor
msarda 2017/03/01 10:26:36 Done.
657 list_accounts_gurl_, net::LOAD_NORMAL); 664 net::LOAD_NORMAL);
658 } 665 }
659 666
660 void GaiaAuthFetcher::StartLogOut() { 667 void GaiaAuthFetcher::StartLogOut() {
661 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; 668 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
662 669
663 CreateAndStartGaiaFetcher(std::string(), logout_headers_, logout_gurl_, 670 CreateAndStartGaiaFetcher(std::string(), logout_headers_, logout_gurl_,
664 net::LOAD_NORMAL); 671 net::LOAD_NORMAL);
665 } 672 }
666 673
667 void GaiaAuthFetcher::StartGetCheckConnectionInfo() { 674 void GaiaAuthFetcher::StartGetCheckConnectionInfo() {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 return alleged_error.find(kSecondFactor) != 1020 return alleged_error.find(kSecondFactor) !=
1014 std::string::npos; 1021 std::string::npos;
1015 } 1022 }
1016 1023
1017 // static 1024 // static
1018 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( 1025 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess(
1019 const std::string& alleged_error) { 1026 const std::string& alleged_error) {
1020 return alleged_error.find(kWebLoginRequired) != 1027 return alleged_error.find(kWebLoginRequired) !=
1021 std::string::npos; 1028 std::string::npos;
1022 } 1029 }
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698