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

Unified Diff: net/base/host_resolver.h

Issue 6993015: Add unit-tests for SingleRequestHostResolver. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: oops Created 9 years, 7 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
Index: net/base/host_resolver.h
===================================================================
--- net/base/host_resolver.h (revision 87744)
+++ net/base/host_resolver.h (working copy)
@@ -199,48 +199,6 @@
DISALLOW_COPY_AND_ASSIGN(HostResolver);
};
-// This class represents the task of resolving a hostname (or IP address
-// literal) to an AddressList object. It wraps HostResolver to resolve only a
-// single hostname at a time and cancels this request when going out of scope.
-class NET_API SingleRequestHostResolver {
- public:
- // |resolver| must remain valid for the lifetime of |this|.
- explicit SingleRequestHostResolver(HostResolver* resolver);
-
- // If a completion callback is pending when the resolver is destroyed, the
- // host resolution is cancelled, and the completion callback will not be
- // called.
- ~SingleRequestHostResolver();
-
- // Resolves the given hostname (or IP address literal), filling out the
- // |addresses| object upon success. See HostResolver::Resolve() for details.
- int Resolve(const HostResolver::RequestInfo& info,
- AddressList* addresses,
- CompletionCallback* callback,
- const BoundNetLog& net_log);
-
- // Cancels the in-progress request, if any. This prevents the callback
- // from being invoked. Resolve() can be called again after cancelling.
- void Cancel();
-
- private:
- // Callback for when the request to |resolver_| completes, so we dispatch
- // to the user's callback.
- void OnResolveCompletion(int result);
-
- // The actual host resolver that will handle the request.
- HostResolver* const resolver_;
-
- // The current request (if any).
- HostResolver::RequestHandle cur_request_;
- CompletionCallback* cur_request_callback_;
-
- // Completion callback for when request to |resolver_| completes.
- CompletionCallbackImpl<SingleRequestHostResolver> callback_;
-
- DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver);
-};
-
// Creates a HostResolver implementation that queries the underlying system.
// (Except if a unit-test has changed the global HostResolverProc using
// ScopedHostResolverProc to intercept requests to the system).

Powered by Google App Engine
This is Rietveld 408576698