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

Unified Diff: net/base/host_resolver_impl.h

Issue 302010: Add a mechanism to disable IPv6.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address darin's comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/host_resolver.h ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.h
===================================================================
--- net/base/host_resolver_impl.h (revision 29420)
+++ net/base/host_resolver_impl.h (working copy)
@@ -27,7 +27,7 @@
// +----------- HostResolverImpl -------------+
// | | |
// Job Job Job
-// (for host1) (for host2) (for hostX)
+// (for host1, fam1) (for host2, fam2) (for hostx, famx)
// / | | / | | / | |
// Request ... Request Request ... Request Request ... Request
// (port1) (port2) (port3) (port4) (port5) (portX)
@@ -70,11 +70,18 @@
// TODO(eroman): temp hack for http://crbug.com/15513
virtual void Shutdown();
+ // Prevents returning IPv6 addresses from Resolve().
+ // The default is to allow IPv6 results.
+ virtual void DisableIPv6(bool disable_ipv6) {
+ disable_ipv6_ = disable_ipv6;
+ }
+
private:
class Job;
class Request;
typedef std::vector<Request*> RequestsList;
- typedef base::hash_map<std::string, scoped_refptr<Job> > JobMap;
+ typedef HostCache::Key Key;
+ typedef std::map<Key, scoped_refptr<Job> > JobMap;
typedef std::vector<Observer*> ObserversList;
// Returns the HostResolverProc to use for this instance.
@@ -86,8 +93,8 @@
// Adds a job to outstanding jobs list.
void AddOutstandingJob(Job* job);
- // Returns the outstanding job for |hostname|, or NULL if there is none.
- Job* FindOutstandingJob(const std::string& hostname);
+ // Returns the outstanding job for |key|, or NULL if there is none.
+ Job* FindOutstandingJob(const Key& key);
// Removes |job| from the outstanding jobs list.
void RemoveOutstandingJob(Job* job);
@@ -132,6 +139,9 @@
// in the case of unit-tests which inject custom host resolving behaviors.
scoped_refptr<HostResolverProc> resolver_proc_;
+ // Set to true if only IPv4 address are to be returned by Resolve().
+ bool disable_ipv6_;
Lorenzo Colitti 2009/10/21 23:14:08 Instead, why not make this be "int desired_address
eroman 2009/10/21 23:32:07 Done. See proposed change here: http://codereview
+
// TODO(eroman): temp hack for http://crbug.com/15513
bool shutdown_;
« no previous file with comments | « net/base/host_resolver.h ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698