Commit c5b37b06 authored by sergeyu's avatar sergeyu Committed by Commit bot

Pass file task runner to net::URLRequestContextBuilder

This avoids creation of an extra file thread in BasicURLRequestContext
and fixes linked bug

BUG=475213

Review URL: https://codereview.chromium.org/1082803004

Cr-Commit-Position: refs/heads/master@{#327082}
parent cd59886d
...@@ -15,7 +15,8 @@ namespace remoting { ...@@ -15,7 +15,8 @@ namespace remoting {
URLRequestContextGetter::URLRequestContextGetter( URLRequestContextGetter::URLRequestContextGetter(
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) scoped_refptr<base::SingleThreadTaskRunner> file_task_runner)
: network_task_runner_(network_task_runner) { : network_task_runner_(network_task_runner),
file_task_runner_(file_task_runner) {
proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService(
network_task_runner_, file_task_runner)); network_task_runner_, file_task_runner));
} }
...@@ -23,6 +24,7 @@ URLRequestContextGetter::URLRequestContextGetter( ...@@ -23,6 +24,7 @@ URLRequestContextGetter::URLRequestContextGetter(
net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
if (!url_request_context_.get()) { if (!url_request_context_.get()) {
net::URLRequestContextBuilder builder; net::URLRequestContextBuilder builder;
builder.SetFileTaskRunner(file_task_runner_);
builder.set_net_log(new VlogNetLog()); builder.set_net_log(new VlogNetLog());
builder.DisableHttpCache(); builder.DisableHttpCache();
builder.set_proxy_config_service(proxy_config_service_.release()); builder.set_proxy_config_service(proxy_config_service_.release());
......
...@@ -35,6 +35,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -35,6 +35,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
private: private:
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::URLRequestContext> url_request_context_; scoped_ptr<net::URLRequestContext> url_request_context_;
......
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