| 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/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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/string_split.h" | 15 #include "base/string_split.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/thread_restrictions.h" | 17 #include "base/thread_restrictions.h" |
| 18 #include "chrome/browser/browser_thread.h" | 18 #include "chrome/browser/browser_thread.h" |
| 19 #include "chrome/browser/gpu_process_host.h" | 19 #include "chrome/browser/gpu_process_host.h" |
| 20 #include "chrome/browser/net/chrome_net_log.h" | 20 #include "chrome/browser/net/chrome_net_log.h" |
| 21 #include "chrome/browser/net/chrome_url_request_context.h" | 21 #include "chrome/browser/net/chrome_url_request_context.h" |
| 22 #include "chrome/browser/net/connect_interceptor.h" | 22 #include "chrome/browser/net/connect_interceptor.h" |
| 23 #include "chrome/browser/net/passive_log_collector.h" | 23 #include "chrome/browser/net/passive_log_collector.h" |
| 24 #include "chrome/browser/net/predictor_api.h" | 24 #include "chrome/browser/net/predictor_api.h" |
| 25 #include "chrome/browser/net/prerender_interceptor.h" | |
| 26 #include "chrome/browser/prefs/pref_service.h" | 25 #include "chrome/browser/prefs/pref_service.h" |
| 26 #include "chrome/browser/prerender/prerender_interceptor.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/net/raw_host_resolver_proc.h" | 28 #include "chrome/common/net/raw_host_resolver_proc.h" |
| 29 #include "chrome/common/net/url_fetcher.h" | 29 #include "chrome/common/net/url_fetcher.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "net/base/dnsrr_resolver.h" | 31 #include "net/base/dnsrr_resolver.h" |
| 32 #include "net/base/host_cache.h" | 32 #include "net/base/host_cache.h" |
| 33 #include "net/base/host_resolver.h" | 33 #include "net/base/host_resolver.h" |
| 34 #include "net/base/host_resolver_impl.h" | 34 #include "net/base/host_resolver_impl.h" |
| 35 #include "net/base/mapped_host_resolver.h" | 35 #include "net/base/mapped_host_resolver.h" |
| 36 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 new LoggingNetworkChangeObserver(net_log_)); | 331 new LoggingNetworkChangeObserver(net_log_)); |
| 332 | 332 |
| 333 globals_->host_resolver.reset( | 333 globals_->host_resolver.reset( |
| 334 CreateGlobalHostResolver(net_log_)); | 334 CreateGlobalHostResolver(net_log_)); |
| 335 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); | 335 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); |
| 336 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( | 336 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( |
| 337 globals_->host_resolver.get())); | 337 globals_->host_resolver.get())); |
| 338 | 338 |
| 339 if (CommandLine::ForCurrentProcess()->HasSwitch( | 339 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 340 switches::kEnablePagePrerender)) { | 340 switches::kEnablePagePrerender)) { |
| 341 prerender_interceptor_.reset( | 341 prerender_interceptor_.reset(new PrerenderInterceptor()); |
| 342 new chrome_browser_net::PrerenderInterceptor()); | |
| 343 } | 342 } |
| 344 } | 343 } |
| 345 | 344 |
| 346 void IOThread::CleanUp() { | 345 void IOThread::CleanUp() { |
| 347 // Step 1: Kill all things that might be holding onto | 346 // Step 1: Kill all things that might be holding onto |
| 348 // net::URLRequest/URLRequestContexts. | 347 // net::URLRequest/URLRequestContexts. |
| 349 | 348 |
| 350 #if defined(USE_NSS) | 349 #if defined(USE_NSS) |
| 351 net::ShutdownOCSP(); | 350 net::ShutdownOCSP(); |
| 352 #endif // defined(USE_NSS) | 351 #endif // defined(USE_NSS) |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 net::HostCache* host_cache = | 515 net::HostCache* host_cache = |
| 517 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 516 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
| 518 if (host_cache) | 517 if (host_cache) |
| 519 host_cache->clear(); | 518 host_cache->clear(); |
| 520 } | 519 } |
| 521 // Clear all of the passively logged data. | 520 // Clear all of the passively logged data. |
| 522 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 521 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
| 523 // clear the data pertaining to off the record context. | 522 // clear the data pertaining to off the record context. |
| 524 net_log_->ClearAllPassivelyCapturedEvents(); | 523 net_log_->ClearAllPassivelyCapturedEvents(); |
| 525 } | 524 } |
| OLD | NEW |