Rename ProxyService class to ProxyResolutionService
https://chromium-review.googlesource.com/857421
This commit is contained in:
parent
079e5df740
commit
7c95100180
3 changed files with 17 additions and 11 deletions
|
@ -261,8 +261,8 @@ class ResolveProxyHelper {
|
|||
const GURL& url) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||
|
||||
net::ProxyService* proxy_service =
|
||||
context_getter->GetURLRequestContext()->proxy_service();
|
||||
net::ProxyResolutionService* proxy_service =
|
||||
context_getter->GetURLRequestContext()->proxy_resolution_service();
|
||||
net::CompletionCallback completion_callback = base::Bind(
|
||||
&ResolveProxyHelper::OnResolveProxyCompleted, base::Unretained(this));
|
||||
|
||||
|
@ -278,7 +278,7 @@ class ResolveProxyHelper {
|
|||
|
||||
Session::ResolveProxyCallback callback_;
|
||||
net::ProxyInfo proxy_info_;
|
||||
net::ProxyService::PacRequest* pac_req_;
|
||||
net::ProxyResolutionService::Request* pac_req_;
|
||||
scoped_refptr<base::SingleThreadTaskRunner> original_thread_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper);
|
||||
|
@ -344,7 +344,8 @@ void DoCacheActionInIO(
|
|||
void SetProxyInIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
||||
const net::ProxyConfig& config,
|
||||
const base::Closure& callback) {
|
||||
auto* proxy_service = getter->GetURLRequestContext()->proxy_service();
|
||||
auto* proxy_service =
|
||||
getter->GetURLRequestContext()->proxy_resolution_service();
|
||||
proxy_service->ResetConfigService(
|
||||
base::WrapUnique(new net::ProxyConfigServiceFixed(config)));
|
||||
// Refetches and applies the new pac script if provided.
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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_));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue