OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/message_loop_proxy.h" |
7 #include "chrome/service/service_process.h" | 8 #include "chrome/service/service_process.h" |
8 #include "net/base/cookie_monster.h" | 9 #include "net/base/cookie_monster.h" |
9 #include "net/base/cookie_policy.h" | 10 #include "net/base/cookie_policy.h" |
10 #include "net/base/dnsrr_resolver.h" | 11 #include "net/base/dnsrr_resolver.h" |
11 #include "net/base/host_resolver.h" | 12 #include "net/base/host_resolver.h" |
12 #include "net/base/ssl_config_service_defaults.h" | 13 #include "net/base/ssl_config_service_defaults.h" |
13 #include "net/ftp/ftp_network_layer.h" | 14 #include "net/ftp/ftp_network_layer.h" |
14 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
15 #include "net/http/http_cache.h" | 16 #include "net/http/http_cache.h" |
16 #include "net/http/http_network_layer.h" | 17 #include "net/http/http_network_layer.h" |
17 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
18 | 19 |
19 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() | |
20 : io_message_loop_proxy_( | |
21 g_service_process->io_thread()->message_loop_proxy()) { | |
22 } | |
23 | |
24 ServiceURLRequestContext::ServiceURLRequestContext() { | 20 ServiceURLRequestContext::ServiceURLRequestContext() { |
25 host_resolver_ = | 21 host_resolver_ = |
26 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 22 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
27 NULL); | 23 NULL); |
28 DCHECK(g_service_process); | 24 DCHECK(g_service_process); |
29 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a | 25 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a |
30 // MessageLoopProxy* instead of MessageLoop*. | 26 // MessageLoopProxy* instead of MessageLoop*. |
31 // Also this needs to be created on the UI thread on Linux. Fix this. | 27 // Also this needs to be created on the UI thread on Linux. Fix this. |
32 net::ProxyConfigService * proxy_config_service = | 28 net::ProxyConfigService * proxy_config_service = |
33 net::ProxyService::CreateSystemProxyConfigService( | 29 net::ProxyService::CreateSystemProxyConfigService( |
(...skipping 20 matching lines...) Expand all Loading... |
54 accept_language_ = "en-us,fr"; | 50 accept_language_ = "en-us,fr"; |
55 accept_charset_ = "iso-8859-1,*,utf-8"; | 51 accept_charset_ = "iso-8859-1,*,utf-8"; |
56 } | 52 } |
57 | 53 |
58 ServiceURLRequestContext::~ServiceURLRequestContext() { | 54 ServiceURLRequestContext::~ServiceURLRequestContext() { |
59 delete ftp_transaction_factory_; | 55 delete ftp_transaction_factory_; |
60 delete http_transaction_factory_; | 56 delete http_transaction_factory_; |
61 delete http_auth_handler_factory_; | 57 delete http_auth_handler_factory_; |
62 delete dnsrr_resolver_; | 58 delete dnsrr_resolver_; |
63 } | 59 } |
| 60 |
| 61 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() |
| 62 : io_message_loop_proxy_( |
| 63 g_service_process->io_thread()->message_loop_proxy()) { |
| 64 } |
| 65 |
| 66 URLRequestContext* ServiceURLRequestContextGetter::GetURLRequestContext() { |
| 67 if (!url_request_context_) |
| 68 url_request_context_ = new ServiceURLRequestContext(); |
| 69 return url_request_context_; |
| 70 } |
| 71 |
| 72 scoped_refptr<base::MessageLoopProxy> |
| 73 ServiceURLRequestContextGetter::GetIOMessageLoopProxy() { |
| 74 return io_message_loop_proxy_; |
| 75 } |
| 76 |
| 77 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
OLD | NEW |