Commit bf274333 authored by Alexandr Ilin's avatar Alexandr Ilin Committed by Commit Bot

predictors: Set extra flags in ResolveHostClientImpl

The predictor used to set the is_speculative flag and lower the priority of
resolve host request. This was missed in the CL https://crrev.com/c/1165550.
This CL restores this parameters for the predictor.

Bug: 809583
Change-Id: Iebfd2ca28bed1a854b6e3b929441b79cfc178f80
Reviewed-on: https://chromium-review.googlesource.com/1180965Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584688}
parent e175e436
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/bindings/interface_request.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "net/base/request_priority.h"
#include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_context.mojom.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -22,7 +23,12 @@ ResolveHostClientImpl::ResolveHostClientImpl( ...@@ -22,7 +23,12 @@ ResolveHostClientImpl::ResolveHostClientImpl(
: binding_(this), callback_(std::move(callback)) { : binding_(this), callback_(std::move(callback)) {
network::mojom::ResolveHostClientPtr resolve_host_client_ptr; network::mojom::ResolveHostClientPtr resolve_host_client_ptr;
binding_.Bind(mojo::MakeRequest(&resolve_host_client_ptr)); binding_.Bind(mojo::MakeRequest(&resolve_host_client_ptr));
network_context->ResolveHost(net::HostPortPair::FromURL(url), nullptr, network::mojom::ResolveHostParametersPtr parameters =
network::mojom::ResolveHostParameters::New();
parameters->initial_priority = net::RequestPriority::IDLE;
parameters->is_speculative = true;
network_context->ResolveHost(net::HostPortPair::FromURL(url),
std::move(parameters),
std::move(resolve_host_client_ptr)); std::move(resolve_host_client_ptr));
binding_.set_connection_error_handler(base::BindOnce( binding_.set_connection_error_handler(base::BindOnce(
&ResolveHostClientImpl::OnConnectionError, base::Unretained(this))); &ResolveHostClientImpl::OnConnectionError, base::Unretained(this)));
......
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