| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 chrome_browser_net::FreeDnsPrefetchResources(); | 122 chrome_browser_net::FreeDnsPrefetchResources(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Not initialized in Init(). May not be initialized. | 125 // Not initialized in Init(). May not be initialized. |
| 126 if (prefetch_observer_) { | 126 if (prefetch_observer_) { |
| 127 globals_->host_resolver->RemoveObserver(prefetch_observer_); | 127 globals_->host_resolver->RemoveObserver(prefetch_observer_); |
| 128 delete prefetch_observer_; | 128 delete prefetch_observer_; |
| 129 prefetch_observer_ = NULL; | 129 prefetch_observer_ = NULL; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // TODO(eroman): temp hack for http://crbug.com/15513 | 132 // TODO(eroman): hack http://crbug.com/15513 |
| 133 globals_->host_resolver->Shutdown(); | 133 if (globals_->host_resolver->IsHostResolverImpl()) { |
| 134 static_cast<net::HostResolverImpl*>( |
| 135 globals_->host_resolver.get())->Shutdown(); |
| 136 } |
| 134 | 137 |
| 135 delete globals_; | 138 delete globals_; |
| 136 globals_ = NULL; | 139 globals_ = NULL; |
| 137 | 140 |
| 138 // URLFetcher and URLRequest instances must NOT outlive the IO thread. | 141 // URLFetcher and URLRequest instances must NOT outlive the IO thread. |
| 139 // | 142 // |
| 140 // Strictly speaking, URLFetcher's CheckForLeaks() should be done on the | 143 // Strictly speaking, URLFetcher's CheckForLeaks() should be done on the |
| 141 // UI thread. However, since there _shouldn't_ be any instances left | 144 // UI thread. However, since there _shouldn't_ be any instances left |
| 142 // at this point, it shouldn't be a race. | 145 // at this point, it shouldn't be a race. |
| 143 // | 146 // |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 187 |
| 185 // Clear the host cache to avoid showing entries from the OTR session | 188 // Clear the host cache to avoid showing entries from the OTR session |
| 186 // in about:net-internals. | 189 // in about:net-internals. |
| 187 if (globals_->host_resolver->IsHostResolverImpl()) { | 190 if (globals_->host_resolver->IsHostResolverImpl()) { |
| 188 net::HostCache* host_cache = static_cast<net::HostResolverImpl*>( | 191 net::HostCache* host_cache = static_cast<net::HostResolverImpl*>( |
| 189 globals_->host_resolver.get())->cache(); | 192 globals_->host_resolver.get())->cache(); |
| 190 if (host_cache) | 193 if (host_cache) |
| 191 host_cache->clear(); | 194 host_cache->clear(); |
| 192 } | 195 } |
| 193 } | 196 } |
| OLD | NEW |