| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "chrome/service/net/service_url_request_context.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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() | 143 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() |
| 144 : network_task_runner_( | 144 : network_task_runner_( |
| 145 g_service_process->io_thread()->message_loop_proxy()) { | 145 g_service_process->io_thread()->message_loop_proxy()) { |
| 146 // Build the default user agent. | 146 // Build the default user agent. |
| 147 user_agent_ = MakeUserAgentForServiceProcess(); | 147 user_agent_ = MakeUserAgentForServiceProcess(); |
| 148 | 148 |
| 149 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a | 149 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a |
| 150 // MessageLoopProxy* instead of MessageLoop*. | 150 // MessageLoopProxy* instead of MessageLoop*. |
| 151 DCHECK(g_service_process); | 151 DCHECK(g_service_process); |
| 152 proxy_config_service_.reset( | 152 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( |
| 153 net::ProxyService::CreateSystemProxyConfigService( | 153 g_service_process->io_thread()->message_loop_proxy().get(), |
| 154 g_service_process->io_thread()->message_loop_proxy(), | 154 g_service_process->file_thread()->message_loop())); |
| 155 g_service_process->file_thread()->message_loop())); | |
| 156 } | 155 } |
| 157 | 156 |
| 158 net::URLRequestContext* | 157 net::URLRequestContext* |
| 159 ServiceURLRequestContextGetter::GetURLRequestContext() { | 158 ServiceURLRequestContextGetter::GetURLRequestContext() { |
| 160 if (!url_request_context_.get()) | 159 if (!url_request_context_.get()) |
| 161 url_request_context_.reset( | 160 url_request_context_.reset( |
| 162 new ServiceURLRequestContext(user_agent_, | 161 new ServiceURLRequestContext(user_agent_, |
| 163 proxy_config_service_.release())); | 162 proxy_config_service_.release())); |
| 164 return url_request_context_.get(); | 163 return url_request_context_.get(); |
| 165 } | 164 } |
| 166 | 165 |
| 167 scoped_refptr<base::SingleThreadTaskRunner> | 166 scoped_refptr<base::SingleThreadTaskRunner> |
| 168 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { | 167 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 169 return network_task_runner_; | 168 return network_task_runner_; |
| 170 } | 169 } |
| 171 | 170 |
| 172 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 171 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
| OLD | NEW |