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 "chrome/service/service_process.h" | 7 #include "chrome/service/service_process.h" |
8 #include "net/base/cookie_monster.h" | 8 #include "net/base/cookie_monster.h" |
9 #include "net/base/cookie_policy.h" | 9 #include "net/base/cookie_policy.h" |
10 #include "net/base/dnsrr_resolver.h" | 10 #include "net/base/dnsrr_resolver.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 26 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
27 NULL); | 27 NULL); |
28 DCHECK(g_service_process); | 28 DCHECK(g_service_process); |
29 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a | 29 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a |
30 // MessageLoopProxy* instead of MessageLoop*. | 30 // MessageLoopProxy* instead of MessageLoop*. |
31 // Also this needs to be created on the UI thread on Linux. Fix this. | 31 // Also this needs to be created on the UI thread on Linux. Fix this. |
32 net::ProxyConfigService * proxy_config_service = | 32 net::ProxyConfigService * proxy_config_service = |
33 net::ProxyService::CreateSystemProxyConfigService( | 33 net::ProxyService::CreateSystemProxyConfigService( |
34 g_service_process->io_thread()->message_loop(), | 34 g_service_process->io_thread()->message_loop(), |
35 g_service_process->file_thread()->message_loop()); | 35 g_service_process->file_thread()->message_loop()); |
36 proxy_service_ = | 36 proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( |
37 net::ProxyService::Create( | 37 proxy_config_service, 0u, NULL); |
38 proxy_config_service, false, 0u, this, NULL, NULL); | |
39 dnsrr_resolver_ = new net::DnsRRResolver; | 38 dnsrr_resolver_ = new net::DnsRRResolver; |
40 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 39 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
41 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 40 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
42 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( | 41 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
43 host_resolver_); | 42 host_resolver_); |
44 http_transaction_factory_ = new net::HttpCache( | 43 http_transaction_factory_ = new net::HttpCache( |
45 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 44 net::HttpNetworkLayer::CreateFactory(host_resolver_, |
46 dnsrr_resolver_, | 45 dnsrr_resolver_, |
47 proxy_service_, | 46 proxy_service_, |
48 ssl_config_service_, | 47 ssl_config_service_, |
49 http_auth_handler_factory_, | 48 http_auth_handler_factory_, |
50 NULL /* network_delegate */, | 49 NULL /* network_delegate */, |
51 NULL /* net_log */), | 50 NULL /* net_log */), |
52 net::HttpCache::DefaultBackend::InMemory(0)); | 51 net::HttpCache::DefaultBackend::InMemory(0)); |
53 // In-memory cookie store. | 52 // In-memory cookie store. |
54 cookie_store_ = new net::CookieMonster(NULL, NULL); | 53 cookie_store_ = new net::CookieMonster(NULL, NULL); |
55 accept_language_ = "en-us,fr"; | 54 accept_language_ = "en-us,fr"; |
56 accept_charset_ = "iso-8859-1,*,utf-8"; | 55 accept_charset_ = "iso-8859-1,*,utf-8"; |
57 } | 56 } |
58 | 57 |
59 ServiceURLRequestContext::~ServiceURLRequestContext() { | 58 ServiceURLRequestContext::~ServiceURLRequestContext() { |
60 delete ftp_transaction_factory_; | 59 delete ftp_transaction_factory_; |
61 delete http_transaction_factory_; | 60 delete http_transaction_factory_; |
62 delete http_auth_handler_factory_; | 61 delete http_auth_handler_factory_; |
63 delete dnsrr_resolver_; | 62 delete dnsrr_resolver_; |
64 } | 63 } |
OLD | NEW |