| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/service/net/service_url_request_context_getter.h" | 5 #include "chrome/service/net/service_url_request_context_getter.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 8 #include <sys/utsname.h> | 8 #include <sys/utsname.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 g_service_process->io_task_runner(), | 101 g_service_process->io_task_runner(), |
| 102 g_service_process->file_task_runner())); | 102 g_service_process->file_task_runner())); |
| 103 } | 103 } |
| 104 | 104 |
| 105 net::URLRequestContext* | 105 net::URLRequestContext* |
| 106 ServiceURLRequestContextGetter::GetURLRequestContext() { | 106 ServiceURLRequestContextGetter::GetURLRequestContext() { |
| 107 if (!url_request_context_.get()) { | 107 if (!url_request_context_.get()) { |
| 108 net::URLRequestContextBuilder builder; | 108 net::URLRequestContextBuilder builder; |
| 109 builder.set_user_agent(user_agent_); | 109 builder.set_user_agent(user_agent_); |
| 110 builder.set_accept_language("en-us,fr"); | 110 builder.set_accept_language("en-us,fr"); |
| 111 builder.set_proxy_config_service(proxy_config_service_.release()); | 111 builder.set_proxy_config_service(proxy_config_service_.Pass()); |
| 112 builder.set_throttling_enabled(true); | 112 builder.set_throttling_enabled(true); |
| 113 url_request_context_.reset(builder.Build()); | 113 url_request_context_ = builder.Build().Pass(); |
| 114 } | 114 } |
| 115 return url_request_context_.get(); | 115 return url_request_context_.get(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 scoped_refptr<base::SingleThreadTaskRunner> | 118 scoped_refptr<base::SingleThreadTaskRunner> |
| 119 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { | 119 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 120 return network_task_runner_; | 120 return network_task_runner_; |
| 121 } | 121 } |
| 122 | 122 |
| 123 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 123 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
| OLD | NEW |