Commit 50633140 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Remove request_completed_ logic in WebRequestProxyingURLLoaderFactory

This is no longer needed after http://crrev.com/c/1949403. We now have
special handling for redirects that restart the loader.

Bug: 1029944
Change-Id: I4c4bf3c5cb108e7428c9a047e1071dd3f7f2db04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956387Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723543}
parent 1659a3c1
......@@ -164,8 +164,6 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
void WebRequestProxyingURLLoaderFactory::InProgressRequest::RestartInternal() {
DCHECK_EQ(info_->url, request_.url)
<< "UpdateRequestInfo must have been called first";
request_completed_ = false;
// If the header client will be used, we start the request immediately, and
// OnBeforeSendHeaders and OnSendHeaders will be handled there. Otherwise,
// send these events before the request starts.
......@@ -858,8 +856,6 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
// reset the request body manually.
if (request_.method == net::HttpRequestHeaders::kGetMethod)
request_.request_body = nullptr;
request_completed_ = true;
}
void WebRequestProxyingURLLoaderFactory::InProgressRequest::
......@@ -901,13 +897,11 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
}
void WebRequestProxyingURLLoaderFactory::InProgressRequest::OnRequestError(
const network::URLLoaderCompletionStatus& status) {
if (!request_completed_) {
if (target_client_)
target_client_->OnComplete(status);
ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred(
factory_->browser_context_, &info_.value(), true /* started */,
status.error_code);
}
if (target_client_)
target_client_->OnComplete(status);
ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred(
factory_->browser_context_, &info_.value(), true /* started */,
status.error_code);
// Deletes |this|.
factory_->RemoveRequest(network_service_request_id_, request_id_);
......@@ -924,8 +918,12 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
// RequestIDGenerator::Generate() with the same ID pair.
factory_->request_id_generator_->SaveID(
routing_id_, network_service_request_id_, request_id_);
// Deletes |this|.
factory_->RemoveRequest(network_service_request_id_, request_id_);
} else {
OnRequestError(network::URLLoaderCompletionStatus(net::ERR_ABORTED));
}
OnRequestError(network::URLLoaderCompletionStatus(net::ERR_ABORTED));
}
// Determines whether it is safe to redirect from |from_url| to |to_url|.
......
......@@ -164,7 +164,6 @@ class WebRequestProxyingURLLoaderFactory
base::Optional<net::AuthCredentials> auth_credentials_;
const bool for_cors_preflight_ = false;
bool request_completed_ = false;
// If |has_any_extra_headers_listeners_| is set to true, the request will be
// sent with the network::mojom::kURLLoadOptionUseHeaderClient option, and
......
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