chore: bump chromium to f755b70e34659441e72c1a928a406 (master) (#21000)
This commit is contained in:
parent
a5c9bd53e0
commit
49b47ee4ed
181 changed files with 1117 additions and 1786 deletions
|
@ -40,7 +40,7 @@ ProxyingURLLoaderFactory::InProgressRequest::InProgressRequest(
|
|||
const network::ResourceRequest& request,
|
||||
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
|
||||
network::mojom::URLLoaderRequest loader_request,
|
||||
network::mojom::URLLoaderClientPtr client)
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client)
|
||||
: factory_(factory),
|
||||
request_(request),
|
||||
original_initiator_(request.request_initiator),
|
||||
|
@ -52,13 +52,12 @@ ProxyingURLLoaderFactory::InProgressRequest::InProgressRequest(
|
|||
proxied_loader_binding_(this, std::move(loader_request)),
|
||||
target_client_(std::move(client)),
|
||||
current_response_(network::mojom::URLResponseHead::New()),
|
||||
proxied_client_binding_(this),
|
||||
// Always use "extraHeaders" mode to be compatible with old APIs, except
|
||||
// when the |request_id_| is zero, which is not supported in Chromium and
|
||||
// only happens in Electron when the request is started from net module.
|
||||
has_any_extra_headers_listeners_(network_service_request_id != 0) {
|
||||
// If there is a client error, clean up the request.
|
||||
target_client_.set_connection_error_handler(base::BindOnce(
|
||||
target_client_.set_disconnect_handler(base::BindOnce(
|
||||
&ProxyingURLLoaderFactory::InProgressRequest::OnRequestError,
|
||||
weak_factory_.GetWeakPtr(),
|
||||
network::URLLoaderCompletionStatus(net::ERR_ABORTED)));
|
||||
|
@ -97,7 +96,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::UpdateRequestInfo() {
|
|||
request_id_, factory_->render_process_id_, request_.render_frame_id,
|
||||
nullptr, routing_id_, request_for_info, false,
|
||||
!(options_ & network::mojom::kURLLoadOptionSynchronous),
|
||||
factory_->IsForServiceWorkerScript()));
|
||||
factory_->IsForServiceWorkerScript(), factory_->navigation_id_));
|
||||
|
||||
current_request_uses_header_client_ =
|
||||
factory_->url_loader_header_client_receiver_.is_bound() &&
|
||||
|
@ -138,8 +137,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::RestartInternal() {
|
|||
// continue or cancel the request.
|
||||
//
|
||||
// We pause the binding here to prevent further client message processing.
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.PauseIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Pause();
|
||||
|
||||
// Pause the header client, since we want to wait until OnBeforeRequest has
|
||||
// finished before processing any future events.
|
||||
|
@ -332,8 +331,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToBeforeSendHeaders(
|
|||
return;
|
||||
}
|
||||
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
|
||||
auto continuation = base::BindRepeating(
|
||||
&InProgressRequest::ContinueToSendHeaders, weak_factory_.GetWeakPtr());
|
||||
|
@ -353,9 +352,9 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToBeforeSendHeaders(
|
|||
// they respond. |continuation| above will be invoked asynchronously to
|
||||
// continue or cancel the request.
|
||||
//
|
||||
// We pause the binding here to prevent further client message processing.
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.PauseIncomingMethodCallProcessing();
|
||||
// We pause the receiver here to prevent further client message processing.
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
return;
|
||||
}
|
||||
DCHECK_EQ(net::OK, result);
|
||||
|
@ -402,8 +401,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToSendHeaders(
|
|||
pending_follow_redirect_params_.reset();
|
||||
}
|
||||
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
|
||||
// Note: In Electron onSendHeaders is called for all protocols.
|
||||
factory_->web_request_api()->OnSendHeaders(&info_.value(), request_,
|
||||
|
@ -425,8 +424,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToStartRequest(
|
|||
return;
|
||||
}
|
||||
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
|
||||
if (header_client_receiver_.is_bound())
|
||||
header_client_receiver_.Resume();
|
||||
|
@ -434,8 +433,6 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToStartRequest(
|
|||
if (!target_loader_.is_bound() && factory_->target_factory_.is_bound()) {
|
||||
// No extensions have cancelled us up to this point, so it's now OK to
|
||||
// initiate the real network request.
|
||||
network::mojom::URLLoaderClientPtr proxied_client;
|
||||
proxied_client_binding_.Bind(mojo::MakeRequest(&proxied_client));
|
||||
uint32_t options = options_;
|
||||
// Even if this request does not use the header client, future redirects
|
||||
// might, so we need to set the option on the loader.
|
||||
|
@ -444,11 +441,12 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToStartRequest(
|
|||
factory_->target_factory_->CreateLoaderAndStart(
|
||||
mojo::MakeRequest(&target_loader_), routing_id_,
|
||||
network_service_request_id_, options, request_,
|
||||
std::move(proxied_client), traffic_annotation_);
|
||||
proxied_client_receiver_.BindNewPipeAndPassRemote(),
|
||||
traffic_annotation_);
|
||||
}
|
||||
|
||||
// From here the lifecycle of this request is driven by subsequent events on
|
||||
// either |proxy_loader_binding_|, |proxy_client_binding_|, or
|
||||
// either |proxy_loader_binding_|, |proxy_client_receiver_|, or
|
||||
// |header_client_receiver_|.
|
||||
}
|
||||
|
||||
|
@ -473,8 +471,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::
|
|||
std::move(on_headers_received_callback_).Run(net::OK, headers, redirect_url_);
|
||||
override_headers_ = nullptr;
|
||||
|
||||
if (proxied_client_binding_)
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
}
|
||||
|
||||
void ProxyingURLLoaderFactory::InProgressRequest::ContinueToResponseStarted(
|
||||
|
@ -508,7 +506,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToResponseStarted(
|
|||
|
||||
// These will get re-bound if a new request is initiated by
|
||||
// |FollowRedirect()|.
|
||||
proxied_client_binding_.Close();
|
||||
proxied_client_receiver_.reset();
|
||||
header_client_receiver_.reset();
|
||||
target_loader_.reset();
|
||||
|
||||
|
@ -518,7 +516,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToResponseStarted(
|
|||
|
||||
info_->AddResponseInfoFromResourceResponse(*current_response_);
|
||||
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
proxied_client_receiver_.Resume();
|
||||
|
||||
factory_->web_request_api()->OnResponseStarted(&info_.value(), request_);
|
||||
target_client_->OnReceiveResponse(std::move(current_response_));
|
||||
|
@ -534,8 +532,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToBeforeRedirect(
|
|||
|
||||
info_->AddResponseInfoFromResourceResponse(*current_response_);
|
||||
|
||||
if (proxied_client_binding_.is_bound())
|
||||
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Resume();
|
||||
|
||||
factory_->web_request_api()->OnBeforeRedirect(&info_.value(), request_,
|
||||
redirect_info.new_url);
|
||||
|
@ -566,7 +564,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::
|
|||
// bugs. The latter doesn't know anything about the redirect. Continuing
|
||||
// the load with it gives unexpected results. See
|
||||
// https://crbug.com/882661#c72.
|
||||
proxied_client_binding_.Close();
|
||||
proxied_client_receiver_.reset();
|
||||
header_client_receiver_.reset();
|
||||
target_loader_.reset();
|
||||
|
||||
|
@ -647,8 +645,9 @@ void ProxyingURLLoaderFactory::InProgressRequest::
|
|||
// they respond. |continuation| above will be invoked asynchronously to
|
||||
// continue or cancel the request.
|
||||
//
|
||||
// We pause the binding here to prevent further client message processing.
|
||||
proxied_client_binding_.PauseIncomingMethodCallProcessing();
|
||||
// We pause the receiver here to prevent further client message processing.
|
||||
if (proxied_client_receiver_.is_bound())
|
||||
proxied_client_receiver_.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -674,6 +673,7 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory(
|
|||
const HandlersMap& intercepted_handlers,
|
||||
content::BrowserContext* browser_context,
|
||||
int render_process_id,
|
||||
base::Optional<int64_t> navigation_id,
|
||||
network::mojom::URLLoaderFactoryRequest loader_request,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory_remote,
|
||||
mojo::PendingReceiver<network::mojom::TrustedURLLoaderHeaderClient>
|
||||
|
@ -683,6 +683,7 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory(
|
|||
intercepted_handlers_(intercepted_handlers),
|
||||
browser_context_(browser_context),
|
||||
render_process_id_(render_process_id),
|
||||
navigation_id_(std::move(navigation_id)),
|
||||
loader_factory_type_(loader_factory_type) {
|
||||
target_factory_.Bind(std::move(target_factory_remote));
|
||||
target_factory_.set_disconnect_handler(base::BindOnce(
|
||||
|
@ -718,7 +719,7 @@ void ProxyingURLLoaderFactory::CreateLoaderAndStart(
|
|||
int32_t request_id,
|
||||
uint32_t options,
|
||||
const network::ResourceRequest& original_request,
|
||||
network::mojom::URLLoaderClientPtr client,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) {
|
||||
// Take a copy so we can mutate the request.
|
||||
network::ResourceRequest request = original_request;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue