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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.cc

Issue 601643002: Use a distinct source parameter on gaia endpoints for the reconcilor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uber
Patch Set: rebased Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: google_apis/gaia/gaia_auth_fetcher.cc
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 55a60627565cc64c5521a4aa1f89e896dd82035d..4e230cd6c43144bcc83b7abb113cf33cde6e624a 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -170,6 +170,27 @@ const char GaiaAuthFetcher::kClientLoginToOAuth2CookiePartCodePrefix[] =
const int GaiaAuthFetcher::kClientLoginToOAuth2CookiePartCodePrefixLength =
arraysize(GaiaAuthFetcher::kClientLoginToOAuth2CookiePartCodePrefix) - 1;
+// static
+GURL GaiaAuthFetcher::BuildListAccountsURL(const std::string& source) {
+ if (source.empty()) {
+ return GaiaUrls::GetInstance()->list_accounts_url();
+ } else {
+ std::string query = GaiaUrls::GetInstance()->list_accounts_url().query();
Mike Lerman 2014/09/26 16:57:07 It seems like the logic in this method and the met
guohui 2014/09/26 17:36:01 +1
Roger Tawa OOO till Jul 10th 2014/09/26 19:42:39 Done.
Roger Tawa OOO till Jul 10th 2014/09/26 19:42:39 Done.
+ return GaiaUrls::GetInstance()->list_accounts_url().Resolve(
+ base::StringPrintf("?source=%s&%s", source.c_str(),
guohui 2014/09/26 17:36:02 do we know if source is not already used by gaia a
Roger Tawa OOO till Jul 10th 2014/09/26 19:42:39 Yes I already checked with gaia folks.
+ query.c_str()));
Mike Lerman 2014/09/26 16:57:07 If query.empty() then you're adding an un-needed &
Roger Tawa OOO till Jul 10th 2014/09/26 19:42:39 Unfortunately, GURL::Resolve("?foo=bar") removes a
Mike Lerman 2014/09/26 20:18:10 I can't find one. Is it worth having a condition,
Roger Tawa OOO till Jul 10th 2014/09/27 00:30:27 Yup, that's why I did not do so.
+ }
+}
+
+// static
+GURL GaiaAuthFetcher::BuildGetCheckConnectionInfoURL(
+ const std::string& source) {
+ return source.empty()
+ ? GaiaUrls::GetInstance()->get_check_connection_info_url()
+ : GaiaUrls::GetInstance()->get_check_connection_info_url().Resolve(
+ base::StringPrintf("?source=%s", source.c_str()));
+}
+
GaiaAuthFetcher::GaiaAuthFetcher(GaiaAuthConsumer* consumer,
const std::string& source,
net::URLRequestContextGetter* getter)
@@ -185,9 +206,8 @@ GaiaAuthFetcher::GaiaAuthFetcher(GaiaAuthConsumer* consumer,
uberauth_token_gurl_(GaiaUrls::GetInstance()->oauth1_login_url().Resolve(
base::StringPrintf(kUberAuthTokenURLFormat, source.c_str()))),
oauth_login_gurl_(GaiaUrls::GetInstance()->oauth1_login_url()),
- list_accounts_gurl_(GaiaUrls::GetInstance()->list_accounts_url()),
- get_check_connection_info_url_(
- GaiaUrls::GetInstance()->get_check_connection_info_url()),
+ list_accounts_gurl_(BuildListAccountsURL(source)),
+ get_check_connection_info_url_(BuildGetCheckConnectionInfoURL(source)),
client_login_to_oauth2_gurl_(
GaiaUrls::GetInstance()->client_login_to_oauth2_url()),
fetch_pending_(false) {}

Powered by Google App Engine
This is Rietveld 408576698