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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.cc

Issue 2035293002: Remove URLRequest::GetResponseCookies and URLRequestJob::GetResponseCookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments rogerta Created 4 years, 6 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 ca6054a33076852a7069e7ec4de4df8cb3d404ac..0940d3c8ea0fecb16cbe6e85b195622f580ef2eb 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -72,6 +72,19 @@ bool ExtractOAuth2TokenPairResponse(const std::string& data,
return true;
}
+void GetCookiesFromResponse(const net::HttpResponseHeaders* headers,
+ net::ResponseCookies* cookies) {
+ if (!headers)
+ return;
+
+ std::string value;
+ size_t iter = 0;
+ while (headers->EnumerateHeader(&iter, "Set-Cookie", &value)) {
+ if (!value.empty())
+ cookies->push_back(value);
+ }
+}
+
const char kListIdpServiceRequested[] = "list_idp";
const char kGetTokenResponseRequested[] = "get_token";
@@ -944,8 +957,9 @@ void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
DVLOG(2) << "data: " << data << "\n";
#endif
- DispatchFetchedRequest(url, data, source->GetCookies(), status,
- response_code);
+ net::ResponseCookies cookies;
+ GetCookiesFromResponse(source->GetResponseHeaders(), &cookies);
+ DispatchFetchedRequest(url, data, cookies, status, response_code);
}
void GaiaAuthFetcher::DispatchFetchedRequest(
« no previous file with comments | « components/policy/core/common/cloud/device_management_service.cc ('k') | google_apis/gaia/gaia_auth_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698