| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/leak_tracker.h" | 8 #include "base/leak_tracker.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "base/string_split.h" | 11 #include "base/string_split.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/browser_thread.h" | 14 #include "chrome/browser/browser_thread.h" |
| 15 #include "chrome/browser/gpu_process_host.h" | 15 #include "chrome/browser/gpu_process_host.h" |
| 16 #include "chrome/browser/net/chrome_net_log.h" | 16 #include "chrome/browser/net/chrome_net_log.h" |
| 17 #include "chrome/browser/net/connect_interceptor.h" |
| 17 #include "chrome/browser/net/predictor_api.h" | 18 #include "chrome/browser/net/predictor_api.h" |
| 18 #include "chrome/browser/net/passive_log_collector.h" | 19 #include "chrome/browser/net/passive_log_collector.h" |
| 19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/net/url_fetcher.h" | 21 #include "chrome/common/net/url_fetcher.h" |
| 21 #include "net/base/dnsrr_resolver.h" | 22 #include "net/base/dnsrr_resolver.h" |
| 22 #include "net/base/mapped_host_resolver.h" | 23 #include "net/base/mapped_host_resolver.h" |
| 23 #include "net/base/host_cache.h" | 24 #include "net/base/host_cache.h" |
| 24 #include "net/base/host_resolver.h" | 25 #include "net/base/host_resolver.h" |
| 25 #include "net/base/host_resolver_impl.h" | 26 #include "net/base/host_resolver_impl.h" |
| 26 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 net::NetLog* net_log_; | 110 net::NetLog* net_log_; |
| 110 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); | 111 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace | 114 } // namespace |
| 114 | 115 |
| 115 // The IOThread object must outlive any tasks posted to the IO thread before the | 116 // The IOThread object must outlive any tasks posted to the IO thread before the |
| 116 // Quit task. | 117 // Quit task. |
| 117 DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread); | 118 DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread); |
| 118 | 119 |
| 120 IOThread::Globals::Globals() {} |
| 121 |
| 122 IOThread::Globals::~Globals() {} |
| 123 |
| 119 IOThread::IOThread() | 124 IOThread::IOThread() |
| 120 : BrowserProcessSubThread(BrowserThread::IO), | 125 : BrowserProcessSubThread(BrowserThread::IO), |
| 121 globals_(NULL), | 126 globals_(NULL), |
| 122 speculative_interceptor_(NULL), | 127 speculative_interceptor_(NULL), |
| 123 predictor_(NULL) {} | 128 predictor_(NULL) {} |
| 124 | 129 |
| 125 IOThread::~IOThread() { | 130 IOThread::~IOThread() { |
| 126 // We cannot rely on our base class to stop the thread since we want our | 131 // We cannot rely on our base class to stop the thread since we want our |
| 127 // CleanUp function to run. | 132 // CleanUp function to run. |
| 128 Stop(); | 133 Stop(); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 net::HostCache* host_cache = | 326 net::HostCache* host_cache = |
| 322 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 327 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
| 323 if (host_cache) | 328 if (host_cache) |
| 324 host_cache->clear(); | 329 host_cache->clear(); |
| 325 } | 330 } |
| 326 // Clear all of the passively logged data. | 331 // Clear all of the passively logged data. |
| 327 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 332 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
| 328 // clear the data pertaining to off the record context. | 333 // clear the data pertaining to off the record context. |
| 329 globals_->net_log->passive_collector()->Clear(); | 334 globals_->net_log->passive_collector()->Clear(); |
| 330 } | 335 } |
| OLD | NEW |