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

Unified Diff: net/proxy/proxy_resolver.h

Issue 2299963002: Reland "Change ProxyResolver::GetProxyForURL() to take a unique_ptr<Request>* " (Closed)
Patch Set: remove fields proposed by eroman Created 4 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/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver.h
diff --git a/net/proxy/proxy_resolver.h b/net/proxy/proxy_resolver.h
index b343c427adc66abb8f7ee4b05410ca8e78ffadbb..91332937873af719dc2a10c9ea1e7359fb4612e8 100644
--- a/net/proxy/proxy_resolver.h
+++ b/net/proxy/proxy_resolver.h
@@ -27,8 +27,11 @@ class ProxyInfo;
// requests at a time.
class NET_EXPORT_PRIVATE ProxyResolver {
public:
- // Opaque pointer type, to return a handle to cancel outstanding requests.
- typedef void* RequestHandle;
+ class Request {
+ public:
+ virtual ~Request() {} // Cancels the request
+ virtual LoadState GetLoadState() = 0;
+ };
ProxyResolver() {}
@@ -39,19 +42,13 @@ class NET_EXPORT_PRIVATE ProxyResolver {
// by running |callback|. If the result code is OK then
// the request was successful and |results| contains the proxy
// resolution information. In the case of asynchronous completion
- // |*request| is written to, and can be passed to CancelRequest().
+ // |*request| is written to. Call request_.reset() to cancel the request
virtual int GetProxyForURL(const GURL& url,
ProxyInfo* results,
const CompletionCallback& callback,
- RequestHandle* request,
+ std::unique_ptr<Request>* request,
const NetLogWithSource& net_log) = 0;
- // Cancels |request|.
- virtual void CancelRequest(RequestHandle request) = 0;
-
- // Gets the LoadState for |request|.
- virtual LoadState GetLoadState(RequestHandle request) const = 0;
-
private:
DISALLOW_COPY_AND_ASSIGN(ProxyResolver);
};
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698