Commit 942d506c authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

Removing dead code from GaiaAuthFetcher

Removing ResponseCookies parameter from GaiaAuthFetcher::DispatchFetchedRequest()

Change-Id: Ib63c24d88ea996cbd99f50789492cf0bc9f9d7fd
Reviewed-on: https://chromium-review.googlesource.com/c/1371891Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615586}
parent 2436b2f1
......@@ -12,10 +12,6 @@
class GoogleServiceAuthError;
class OAuthMultiloginResult;
namespace net {
typedef std::vector<std::string> ResponseCookies;
}
typedef std::map<std::string, std::string> UserInfoMap;
// An interface that defines the callbacks for objects that
......
......@@ -78,16 +78,6 @@ ExtractOAuth2TokenPairResponse(const std::string& data) {
service_flags.is_under_advanced_protection);
}
void GetCookiesFromResponse(
const network::HttpRawRequestResponseInfo::HeadersVector& headers,
net::ResponseCookies* cookies) {
for (const auto& header : headers) {
if (header.first == "Set-Cookie" && !header.second.empty()) {
cookies->push_back(header.second);
}
}
}
// Parses server responses for token revocation.
GaiaAuthConsumer::TokenRevocationStatus
GetTokenRevocationStatusFromResponseData(const std::string& data,
......@@ -1116,21 +1106,18 @@ void GaiaAuthFetcher::OnURLLoadCompleteInternal(
const network::HttpRawRequestResponseInfo::HeadersVector& headers,
std::string data) {
fetch_pending_ = false;
net::ResponseCookies cookies;
GetCookiesFromResponse(headers, &cookies);
// Some of the GAIA requests perform redirects, which results in the final URL
// of the fetcher not being the original URL requested. Therefore use the
// original URL when determining which OnXXX function to call.
GURL url = original_url_;
original_url_ = GURL();
DispatchFetchedRequest(url, data, cookies, net_error, response_code);
DispatchFetchedRequest(url, data, net_error, response_code);
}
void GaiaAuthFetcher::DispatchFetchedRequest(
const GURL& url,
const std::string& data,
const net::ResponseCookies& cookies,
net::Error net_error,
int response_code) {
if (url == oauth2_token_gurl_) {
......
......@@ -211,7 +211,6 @@ class GaiaAuthFetcher {
// Dispatch the results of a request.
void DispatchFetchedRequest(const GURL& url,
const std::string& data,
const net::ResponseCookies& cookies,
net::Error net_error,
int response_code);
......
......@@ -68,7 +68,6 @@ class GaiaAuthFetcherIOS : public GaiaAuthFetcher {
const net::NetworkTrafficAnnotationTag& traffic_annotation) override;
void FetchComplete(const GURL& url,
const std::string& data,
const net::ResponseCookies& cookies,
const net::URLRequestStatus& status,
int response_code);
......
......@@ -253,8 +253,7 @@ void GaiaAuthFetcherIOSBridge::URLFetchSuccess(const std::string& data) {
GURL url = FinishPendingRequest();
// WKWebViewNavigationDelegate API doesn't give any way to get the HTTP
// response code of a navigation. Default to 200 for success.
fetcher_->FetchComplete(url, data, net::ResponseCookies(),
net::URLRequestStatus(), 200);
fetcher_->FetchComplete(url, data, net::URLRequestStatus(), 200);
}
void GaiaAuthFetcherIOSBridge::URLFetchFailure(bool is_cancelled) {
......@@ -265,7 +264,7 @@ void GaiaAuthFetcherIOSBridge::URLFetchFailure(bool is_cancelled) {
// WKWebViewNavigationDelegate API doesn't give any way to get the HTTP
// response code of a navigation. Default to 500 for error.
int error = is_cancelled ? net::ERR_ABORTED : net::ERR_FAILED;
fetcher_->FetchComplete(url, std::string(), net::ResponseCookies(),
fetcher_->FetchComplete(url, std::string(),
net::URLRequestStatus::FromError(error), 500);
}
......@@ -376,14 +375,12 @@ void GaiaAuthFetcherIOS::CancelRequest() {
void GaiaAuthFetcherIOS::FetchComplete(const GURL& url,
const std::string& data,
const net::ResponseCookies& cookies,
const net::URLRequestStatus& status,
int response_code) {
DVLOG(2) << "Response " << url.spec() << ", code = " << response_code << "\n";
DVLOG(2) << "data: " << data << "\n";
SetPendingFetch(false);
DispatchFetchedRequest(url, data, cookies,
static_cast<net::Error>(status.error()),
DispatchFetchedRequest(url, data, static_cast<net::Error>(status.error()),
response_code);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment