Rename ProxyService class to ProxyResolutionService

https://chromium-review.googlesource.com/857421
This commit is contained in:
Aleksei Kuzmin 2018-04-05 23:28:05 +02:00 committed by Samuel Attard
parent 079e5df740
commit 7c95100180
3 changed files with 17 additions and 11 deletions

View file

@ -28,7 +28,8 @@ IOThread::~IOThread() {
void IOThread::Init() {
net::URLRequestContextBuilder builder;
builder.set_proxy_service(net::ProxyService::CreateDirect());
builder.set_proxy_resolution_service(
net::ProxyResolutionService::CreateDirect());
url_request_context_ = builder.Build();
url_request_context_getter_ = new net::TrivialURLRequestContextGetter(
url_request_context_.get(), base::ThreadTaskRunnerHandle::Get());

View file

@ -148,7 +148,8 @@ URLRequestContextGetter::URLRequestContextGetter(
// must synchronously run on the glib message loop. This will be passed to
// the URLRequestContextStorage on the IO thread in GetURLRequestContext().
proxy_config_service_ =
net::ProxyService::CreateSystemProxyConfigService(io_task_runner_);
net::ProxyResolutionService::CreateSystemProxyConfigService(
io_task_runner_);
}
URLRequestContextGetter::~URLRequestContextGetter() {}
@ -248,22 +249,25 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
// --proxy-server
if (command_line.HasSwitch(switches::kNoProxyServer)) {
storage_->set_proxy_service(net::ProxyService::CreateDirect());
storage_->set_proxy_resolution_service(
net::ProxyResolutionService::CreateDirect());
} else if (command_line.HasSwitch(switches::kProxyServer)) {
net::ProxyConfig proxy_config;
proxy_config.proxy_rules().ParseFromString(
command_line.GetSwitchValueASCII(switches::kProxyServer));
proxy_config.proxy_rules().bypass_rules.ParseFromString(
command_line.GetSwitchValueASCII(switches::kProxyBypassList));
storage_->set_proxy_service(net::ProxyService::CreateFixed(proxy_config));
storage_->set_proxy_resolution_service(
net::ProxyResolutionService::CreateFixed(proxy_config));
} else if (command_line.HasSwitch(switches::kProxyPacUrl)) {
auto proxy_config = net::ProxyConfig::CreateFromCustomPacURL(
GURL(command_line.GetSwitchValueASCII(switches::kProxyPacUrl)));
proxy_config.set_pac_mandatory(true);
storage_->set_proxy_service(net::ProxyService::CreateFixed(proxy_config));
storage_->set_proxy_resolution_service(
net::ProxyResolutionService::CreateFixed(proxy_config));
} else {
storage_->set_proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
storage_->set_proxy_resolution_service(
net::ProxyResolutionService::CreateUsingSystemProxyResolver(
std::move(proxy_config_service_), net_log_));
}