diff options
author | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 21:50:40 +0000 |
---|---|---|
committer | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 21:50:40 +0000 |
commit | 95a214cd9711f435d3c964df768d394163e5c353 (patch) | |
tree | 000931469e217e37f27a93342f30408350367127 /net/base/host_resolver.h | |
parent | 8e42ba22706ce8ca0fd374351f4221a26ebd5e0a (diff) | |
download | chromium_src-95a214cd9711f435d3c964df768d394163e5c353.zip chromium_src-95a214cd9711f435d3c964df768d394163e5c353.tar.gz chromium_src-95a214cd9711f435d3c964df768d394163e5c353.tar.bz2 |
HostResolver: don't interpret NULL callback argument as a request to do synchronous resolution.
BUG=90547,60149
TEST=net_unittests
Review URL: http://codereview.chromium.org/7492059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver.h')
-rw-r--r-- | net/base/host_resolver.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 53a86da..d2b6a35 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -65,9 +65,6 @@ class NET_API HostResolver { bool allow_cached_response() const { return allow_cached_response_; } void set_allow_cached_response(bool b) { allow_cached_response_ = b; } - bool only_use_cached_response() const { return only_use_cached_response_; } - void set_only_use_cached_response(bool b) { only_use_cached_response_ = b; } - bool is_speculative() const { return is_speculative_; } void set_is_speculative(bool b) { is_speculative_ = b; } @@ -90,9 +87,6 @@ class NET_API HostResolver { // Whether it is ok to return a result from the host cache. bool allow_cached_response_; - // Whether the response will only use the cache. - bool only_use_cached_response_; - // Whether this request was started by the DNS prefetcher. bool is_speculative_; @@ -146,18 +140,16 @@ class NET_API HostResolver { // Resolves the given hostname (or IP address literal), filling out the // |addresses| object upon success. The |info.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. + // successful or an error code upon failure. Returns + // ERR_NAME_NOT_RESOLVED if hostname is invalid, or if it is an + // incompatible IP literal (e.g. IPv6 is disabled and it is an IPv6 + // literal). // // If the operation cannnot be completed synchronously, ERR_IO_PENDING will // be returned and the real result code will be passed to the completion // callback. Otherwise the result code is returned immediately from this // call. // - // When |callback| is null, there are two possibilities: either an IP - // address literal is being resolved or lookup should be performed from - // cache only, meaning info.only_use_cached_response() should be true; in - // both cases operation should complete synchronously. - // // If |out_req| is non-NULL, then |*out_req| will be filled with a handle to // the async request. This handle is not valid after the request has // completed. @@ -169,6 +161,14 @@ class NET_API HostResolver { RequestHandle* out_req, const BoundNetLog& net_log) = 0; + // Resolves the given hostname (or IP address literal) out of cache + // only. This is guaranteed to complete synchronously. This acts like + // |Resolve()| if the hostname is IP literal or cached value exists. + // Otherwise, ERR_DNS_CACHE_MISS is returned. + virtual int ResolveFromCache(const RequestInfo& info, + AddressList* addresses, + const BoundNetLog& net_log) = 0; + // Cancels the specified request. |req| is the handle returned by Resolve(). // After a request is cancelled, its completion callback will not be called. virtual void CancelRequest(RequestHandle req) = 0; |