OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/net/dns_global.h" | 5 #include "chrome/browser/net/dns_global.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 dns_master->DiscardAllResults(); | 473 dns_master->DiscardAllResults(); |
474 } | 474 } |
475 | 475 |
476 //------------------------------------------------------------------------------ | 476 //------------------------------------------------------------------------------ |
477 | 477 |
478 net::HostResolver* GetGlobalHostResolver() { | 478 net::HostResolver* GetGlobalHostResolver() { |
479 // Called from UI thread. | 479 // Called from UI thread. |
480 if (!global_host_resolver) { | 480 if (!global_host_resolver) { |
481 global_host_resolver = net::CreateSystemHostResolver(); | 481 global_host_resolver = net::CreateSystemHostResolver(); |
482 | 482 |
483 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIPv6)) | 483 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIPv6)) { |
484 global_host_resolver->DisableIPv6(true); | 484 global_host_resolver->SetDefaultAddressFamily( |
| 485 net::ADDRESS_FAMILY_IPV4); |
| 486 } |
485 } | 487 } |
486 return global_host_resolver; | 488 return global_host_resolver; |
487 } | 489 } |
488 | 490 |
489 //------------------------------------------------------------------------------ | 491 //------------------------------------------------------------------------------ |
490 // Functions to handle saving of hostnames from one session to the next, to | 492 // Functions to handle saving of hostnames from one session to the next, to |
491 // expedite startup times. | 493 // expedite startup times. |
492 | 494 |
493 void SaveHostNamesForNextStartup(PrefService* local_state) { | 495 void SaveHostNamesForNextStartup(PrefService* local_state) { |
494 if (!dns_prefetch_enabled) | 496 if (!dns_prefetch_enabled) |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 } | 622 } |
621 } | 623 } |
622 | 624 |
623 DnsPrefetcherInit::~DnsPrefetcherInit() { | 625 DnsPrefetcherInit::~DnsPrefetcherInit() { |
624 if (dns_master) | 626 if (dns_master) |
625 FreeDnsPrefetchResources(); | 627 FreeDnsPrefetchResources(); |
626 } | 628 } |
627 | 629 |
628 } // namespace chrome_browser_net | 630 } // namespace chrome_browser_net |
629 | 631 |
OLD | NEW |