| 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" |
| 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/threading/thread_restrictions.h" | 17 #include "base/threading/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/in_process_webkit/indexed_db_key_utility_client.h" |
| 20 #include "chrome/browser/net/chrome_net_log.h" | 21 #include "chrome/browser/net/chrome_net_log.h" |
| 21 #include "chrome/browser/net/chrome_url_request_context.h" | 22 #include "chrome/browser/net/chrome_url_request_context.h" |
| 22 #include "chrome/browser/net/connect_interceptor.h" | 23 #include "chrome/browser/net/connect_interceptor.h" |
| 23 #include "chrome/browser/net/passive_log_collector.h" | 24 #include "chrome/browser/net/passive_log_collector.h" |
| 24 #include "chrome/browser/net/predictor_api.h" | 25 #include "chrome/browser/net/predictor_api.h" |
| 25 #include "chrome/browser/prefs/pref_service.h" | 26 #include "chrome/browser/prefs/pref_service.h" |
| 26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/net/raw_host_resolver_proc.h" | 28 #include "chrome/common/net/raw_host_resolver_proc.h" |
| 28 #include "chrome/common/net/url_fetcher.h" | 29 #include "chrome/common/net/url_fetcher.h" |
| 29 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Step 1: Kill all things that might be holding onto | 357 // Step 1: Kill all things that might be holding onto |
| 357 // net::URLRequest/net::URLRequestContexts. | 358 // net::URLRequest/net::URLRequestContexts. |
| 358 | 359 |
| 359 #if defined(USE_NSS) | 360 #if defined(USE_NSS) |
| 360 net::ShutdownOCSP(); | 361 net::ShutdownOCSP(); |
| 361 #endif // defined(USE_NSS) | 362 #endif // defined(USE_NSS) |
| 362 | 363 |
| 363 // Destroy all URLRequests started by URLFetchers. | 364 // Destroy all URLRequests started by URLFetchers. |
| 364 URLFetcher::CancelAll(); | 365 URLFetcher::CancelAll(); |
| 365 | 366 |
| 367 IndexedDBKeyUtilityClient::Shutdown(); |
| 368 |
| 366 // If any child processes are still running, terminate them and | 369 // If any child processes are still running, terminate them and |
| 367 // and delete the BrowserChildProcessHost instances to release whatever | 370 // and delete the BrowserChildProcessHost instances to release whatever |
| 368 // IO thread only resources they are referencing. | 371 // IO thread only resources they are referencing. |
| 369 BrowserChildProcessHost::TerminateAll(); | 372 BrowserChildProcessHost::TerminateAll(); |
| 370 | 373 |
| 371 std::list<ChromeURLRequestContextGetter*> url_request_context_getters; | 374 std::list<ChromeURLRequestContextGetter*> url_request_context_getters; |
| 372 url_request_context_getters.swap(url_request_context_getters_); | 375 url_request_context_getters.swap(url_request_context_getters_); |
| 373 for (std::list<ChromeURLRequestContextGetter*>::iterator it = | 376 for (std::list<ChromeURLRequestContextGetter*>::iterator it = |
| 374 url_request_context_getters.begin(); | 377 url_request_context_getters.begin(); |
| 375 it != url_request_context_getters.end(); ++it) { | 378 it != url_request_context_getters.end(); ++it) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 net::HostCache* host_cache = | 509 net::HostCache* host_cache = |
| 507 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 510 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
| 508 if (host_cache) | 511 if (host_cache) |
| 509 host_cache->clear(); | 512 host_cache->clear(); |
| 510 } | 513 } |
| 511 // Clear all of the passively logged data. | 514 // Clear all of the passively logged data. |
| 512 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 515 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
| 513 // clear the data pertaining to off the record context. | 516 // clear the data pertaining to off the record context. |
| 514 net_log_->ClearAllPassivelyCapturedEvents(); | 517 net_log_->ClearAllPassivelyCapturedEvents(); |
| 515 } | 518 } |
| OLD | NEW |