summaryrefslogtreecommitdiffstats
path: root/net/base/host_resolver.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 05:58:32 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 05:58:32 +0000
commit3db1536436d21dac66de1414a40a57560b7eee96 (patch)
tree6f692f7c69497506572c3ab4f5a3e73229046dea /net/base/host_resolver.h
parent2baf83d75ea5d1233d3ddcf8e28aa4f4466c115c (diff)
downloadchromium_src-3db1536436d21dac66de1414a40a57560b7eee96.zip
chromium_src-3db1536436d21dac66de1414a40a57560b7eee96.tar.gz
chromium_src-3db1536436d21dac66de1414a40a57560b7eee96.tar.bz2
A more portable HostResolver implementation.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver.h')
-rw-r--r--net/base/host_resolver.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index 2ef7b86..34feacd 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -40,8 +40,16 @@ namespace net {
class AddressList;
-// This class represents the task of resolving a single hostname. To resolve
-// multiple hostnames, a new resolver will need to be created for each.
+// This class represents the task of resolving a hostname (or IP address
+// literal) to an AddressList object. It can only resolve a single hostname at
+// a time, so if you need to resolve multiple hostnames at the same time, you
+// will need to allocate a HostResolver object for each hostname.
+//
+// No attempt is made at this level to cache or pin resolution results. For
+// each request, this API talks directly to the underlying name resolver of
+// the local system, which may or may not result in a DNS query. The exact
+// behavior depends on the system configuration.
+//
class HostResolver {
public:
HostResolver();
@@ -51,10 +59,10 @@ class HostResolver {
// called.
~HostResolver();
- // Resolves the given hostname, filling out the |addresses| object upon
- // success. The |port| parameter will be set as the sin(6)_port field of
- // the sockaddr_in{6} struct. Returns OK if successful or an error code
- // upon failure.
+ // Resolves the given hostname (or IP address literal), filling out the
+ // |addresses| object upon success. The |port| parameter will be set as the
+ // sin(6)_port field of the sockaddr_in{6} struct. Returns OK if successful
+ // or an error code upon failure.
//
// When callback is non-null, ERR_IO_PENDING is returned if the operation
// could not be completed synchronously, in which case the result code will
@@ -64,7 +72,8 @@ class HostResolver {
AddressList* addresses, CompletionCallback* callback);
private:
- struct Request;
+ class Request;
+ friend class Request;
scoped_refptr<Request> request_;
DISALLOW_EVIL_CONSTRUCTORS(HostResolver);
};