| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_tracker.h" | 10 #include "base/debug/leak_tracker.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "net/base/cert_verifier.h" | 31 #include "net/base/cert_verifier.h" |
| 32 #include "net/base/dnsrr_resolver.h" | 32 #include "net/base/dnsrr_resolver.h" |
| 33 #include "net/base/host_cache.h" | 33 #include "net/base/host_cache.h" |
| 34 #include "net/base/host_resolver.h" | 34 #include "net/base/host_resolver.h" |
| 35 #include "net/base/host_resolver_impl.h" | 35 #include "net/base/host_resolver_impl.h" |
| 36 #include "net/base/mapped_host_resolver.h" | 36 #include "net/base/mapped_host_resolver.h" |
| 37 #include "net/base/net_util.h" | 37 #include "net/base/net_util.h" |
| 38 #include "net/http/http_auth_filter.h" | 38 #include "net/http/http_auth_filter.h" |
| 39 #include "net/http/http_auth_handler_factory.h" | 39 #include "net/http/http_auth_handler_factory.h" |
| 40 #include "net/http/http_network_layer.h" | 40 #include "net/http/http_network_layer.h" |
| 41 #include "net/http/http_network_session.h" |
| 41 #if defined(USE_NSS) | 42 #if defined(USE_NSS) |
| 42 #include "net/ocsp/nss_ocsp.h" | 43 #include "net/ocsp/nss_ocsp.h" |
| 43 #endif // defined(USE_NSS) | 44 #endif // defined(USE_NSS) |
| 44 #include "net/proxy/proxy_script_fetcher_impl.h" | 45 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 45 #include "net/socket/client_socket_factory.h" | 46 #include "net/socket/client_socket_factory.h" |
| 46 #include "net/spdy/spdy_session_pool.h" | 47 #include "net/spdy/spdy_session_pool.h" |
| 47 | 48 |
| 48 namespace { | 49 namespace { |
| 49 | 50 |
| 50 net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { | 51 net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 globals_->cert_verifier.reset(new net::CertVerifier); | 327 globals_->cert_verifier.reset(new net::CertVerifier); |
| 327 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); | 328 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); |
| 328 // TODO(willchan): Use the real SSLConfigService. | 329 // TODO(willchan): Use the real SSLConfigService. |
| 329 globals_->ssl_config_service = | 330 globals_->ssl_config_service = |
| 330 net::SSLConfigService::CreateSystemSSLConfigService(); | 331 net::SSLConfigService::CreateSystemSSLConfigService(); |
| 331 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( | 332 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( |
| 332 globals_->host_resolver.get())); | 333 globals_->host_resolver.get())); |
| 333 // For the ProxyScriptFetcher, we use a direct ProxyService. | 334 // For the ProxyScriptFetcher, we use a direct ProxyService. |
| 334 globals_->proxy_script_fetcher_proxy_service = | 335 globals_->proxy_script_fetcher_proxy_service = |
| 335 net::ProxyService::CreateDirectWithNetLog(net_log_); | 336 net::ProxyService::CreateDirectWithNetLog(net_log_); |
| 336 globals_->proxy_script_fetcher_http_transaction_factory.reset( | 337 scoped_refptr<net::HttpNetworkSession> network_session( |
| 337 new net::HttpNetworkLayer( | 338 new net::HttpNetworkSession( |
| 338 globals_->client_socket_factory, | |
| 339 globals_->host_resolver.get(), | 339 globals_->host_resolver.get(), |
| 340 globals_->cert_verifier.get(), | 340 globals_->cert_verifier.get(), |
| 341 globals_->dnsrr_resolver.get(), | 341 globals_->dnsrr_resolver.get(), |
| 342 NULL /* dns_cert_checker */, | 342 NULL /* dns_cert_checker */, |
| 343 NULL /* ssl_host_info_factory */, | 343 NULL /* ssl_host_info_factory */, |
| 344 globals_->proxy_script_fetcher_proxy_service.get(), | 344 globals_->proxy_script_fetcher_proxy_service.get(), |
| 345 globals_->client_socket_factory, |
| 345 globals_->ssl_config_service.get(), | 346 globals_->ssl_config_service.get(), |
| 346 new net::SpdySessionPool(globals_->ssl_config_service.get()), | 347 new net::SpdySessionPool(globals_->ssl_config_service.get()), |
| 347 globals_->http_auth_handler_factory.get(), | 348 globals_->http_auth_handler_factory.get(), |
| 348 &globals_->network_delegate, | 349 &globals_->network_delegate, |
| 349 net_log_)); | 350 net_log_)); |
| 351 globals_->proxy_script_fetcher_http_transaction_factory.reset( |
| 352 new net::HttpNetworkLayer(network_session)); |
| 350 | 353 |
| 351 scoped_refptr<net::URLRequestContext> proxy_script_fetcher_context = | 354 scoped_refptr<net::URLRequestContext> proxy_script_fetcher_context = |
| 352 ConstructProxyScriptFetcherContext(globals_, net_log_); | 355 ConstructProxyScriptFetcherContext(globals_, net_log_); |
| 353 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context; | 356 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context; |
| 354 } | 357 } |
| 355 | 358 |
| 356 void IOThread::CleanUp() { | 359 void IOThread::CleanUp() { |
| 357 // Step 1: Kill all things that might be holding onto | 360 // Step 1: Kill all things that might be holding onto |
| 358 // net::URLRequest/net::URLRequestContexts. | 361 // net::URLRequest/net::URLRequestContexts. |
| 359 | 362 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 net::HostCache* host_cache = | 512 net::HostCache* host_cache = |
| 510 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 513 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
| 511 if (host_cache) | 514 if (host_cache) |
| 512 host_cache->clear(); | 515 host_cache->clear(); |
| 513 } | 516 } |
| 514 // Clear all of the passively logged data. | 517 // Clear all of the passively logged data. |
| 515 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 518 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
| 516 // clear the data pertaining to off the record context. | 519 // clear the data pertaining to off the record context. |
| 517 net_log_->ClearAllPassivelyCapturedEvents(); | 520 net_log_->ClearAllPassivelyCapturedEvents(); |
| 518 } | 521 } |
| OLD | NEW |