Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/browser/net/dns_global.cc

Issue 303026: Refactor: Change the interface HostResolver::DisableIPv6() to HostResolver::SetDefaultA... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add another comment by the switch Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698