| 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 18 matching lines...) Expand all Loading... |
| 29 // The FixedHostResolver allows us to send all network requests through | 29 // The FixedHostResolver allows us to send all network requests through |
| 30 // a designated test server. | 30 // a designated test server. |
| 31 if (command_line.HasSwitch(switches::kFixedHost)) { | 31 if (command_line.HasSwitch(switches::kFixedHost)) { |
| 32 std::string host = | 32 std::string host = |
| 33 command_line.GetSwitchValueASCII(switches::kFixedHost); | 33 command_line.GetSwitchValueASCII(switches::kFixedHost); |
| 34 global_host_resolver = new net::FixedHostResolver(host); | 34 global_host_resolver = new net::FixedHostResolver(host); |
| 35 } else { | 35 } else { |
| 36 global_host_resolver = | 36 global_host_resolver = |
| 37 net::CreateSystemHostResolver(network_change_notifier); | 37 net::CreateSystemHostResolver(network_change_notifier); |
| 38 | 38 |
| 39 if (command_line.HasSwitch(switches::kDisableIPv6)) | 39 // if (command_line.HasSwitch(switches::kDisableIPv6)) |
| 40 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | 40 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); |
| 41 } | 41 } |
| 42 | 42 |
| 43 return global_host_resolver; | 43 return global_host_resolver; |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 // The IOThread object must outlive any tasks posted to the IO thread before the | 48 // The IOThread object must outlive any tasks posted to the IO thread before the |
| 49 // Quit task. | 49 // Quit task. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // Clear the host cache to avoid showing entries from the OTR session | 185 // Clear the host cache to avoid showing entries from the OTR session |
| 186 // in about:net-internals. | 186 // in about:net-internals. |
| 187 if (globals_->host_resolver->IsHostResolverImpl()) { | 187 if (globals_->host_resolver->IsHostResolverImpl()) { |
| 188 net::HostCache* host_cache = static_cast<net::HostResolverImpl*>( | 188 net::HostCache* host_cache = static_cast<net::HostResolverImpl*>( |
| 189 globals_->host_resolver.get())->cache(); | 189 globals_->host_resolver.get())->cache(); |
| 190 if (host_cache) | 190 if (host_cache) |
| 191 host_cache->clear(); | 191 host_cache->clear(); |
| 192 } | 192 } |
| 193 } | 193 } |
| OLD | NEW |