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 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/leak_tracker.h" | 7 #include "base/leak_tracker.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 DCHECK(!globals_); | 131 DCHECK(!globals_); |
132 globals_ = new Globals; | 132 globals_ = new Globals; |
133 | 133 |
134 globals_->net_log.reset(new ChromeNetLog()); | 134 globals_->net_log.reset(new ChromeNetLog()); |
135 globals_->host_resolver = CreateGlobalHostResolver(); | 135 globals_->host_resolver = CreateGlobalHostResolver(); |
136 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory()); | 136 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory()); |
137 } | 137 } |
138 | 138 |
139 void IOThread::CleanUp() { | 139 void IOThread::CleanUp() { |
140 // If any child processes are still running, terminate them and | 140 // If any child processes are still running, terminate them and |
141 // and delete the ChildProcessHost instances to release whatever | 141 // and delete the BrowserChildProcessHost instances to release whatever |
142 // IO thread only resources they are referencing. | 142 // IO thread only resources they are referencing. |
143 ChildProcessHost::TerminateAll(); | 143 BrowserChildProcessHost::TerminateAll(); |
144 | 144 |
145 // Not initialized in Init(). May not be initialized. | 145 // Not initialized in Init(). May not be initialized. |
146 if (predictor_) { | 146 if (predictor_) { |
147 predictor_->Shutdown(); | 147 predictor_->Shutdown(); |
148 | 148 |
149 // TODO(willchan): Stop reference counting Predictor. It's owned by | 149 // TODO(willchan): Stop reference counting Predictor. It's owned by |
150 // IOThread now. | 150 // IOThread now. |
151 predictor_->Release(); | 151 predictor_->Release(); |
152 predictor_ = NULL; | 152 predictor_ = NULL; |
153 chrome_browser_net::FreePredictorResources(); | 153 chrome_browser_net::FreePredictorResources(); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 net::HostCache* host_cache = | 303 net::HostCache* host_cache = |
304 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 304 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
305 if (host_cache) | 305 if (host_cache) |
306 host_cache->clear(); | 306 host_cache->clear(); |
307 } | 307 } |
308 // Clear all of the passively logged data. | 308 // Clear all of the passively logged data. |
309 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 309 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
310 // clear the data pertaining to off the record context. | 310 // clear the data pertaining to off the record context. |
311 globals_->net_log->passive_collector()->Clear(); | 311 globals_->net_log->passive_collector()->Clear(); |
312 } | 312 } |
OLD | NEW |