diff options
author | eroman <eroman@chromium.org> | 2016-02-29 13:16:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-29 21:18:07 +0000 |
commit | 9c8f42482a36ed8f614e1ae35eb137300cdbe6eb (patch) | |
tree | 263d786fd82df000ea99802cb39afc56dad090c5 /net/proxy/proxy_resolver.h | |
parent | 4c79a5837aba384a557bb02f26a5ad4e37c91a21 (diff) | |
download | chromium_src-9c8f42482a36ed8f614e1ae35eb137300cdbe6eb.zip chromium_src-9c8f42482a36ed8f614e1ae35eb137300cdbe6eb.tar.gz chromium_src-9c8f42482a36ed8f614e1ae35eb137300cdbe6eb.tar.bz2 |
Revert of Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (patchset #11 id:200001 of https://codereview.chromium.org/1439053002/ )
Reason for revert:
Top crasher on Canary has PAC script cancellation on callstack. Very likely a bug or interaction with this CL.
Reverting until I have a chance to fully investigate.
Original issue's description:
> Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle*
>
> * ProxyResolver::GetProxyForURL() fills a |scoped_pointer<Request>*|
> rather than a |void*|
> * ProxyResolver::CancelRequest(void*) has been removed. Requests
> are instead cancelled by resetting the scoped_ptr<Request>.
>
> This makes for less error prone code as cancellation of
> requests is automatic when the
> scoped_ptr<Request> goes out of scope.
> ProxyResolver::GetLoadState() is removed and replaced
> by Request::GetLoadState().
>
> Also made some renaming, as there were similar class
> named Job or Request. Now they are all Job and this new thing
> is Request.
>
> Referencing by address to object in vector was not wise in net/proxy/mojo_proxy_resolver_impl_unittest.cc which is now fixed by using scoped_ptrs in that vector.
>
> BUG=478934
>
> Committed: https://crrev.com/a750e126346aa42df1b0cbc2ae6a58abbe7a5069
> Cr-Commit-Position: refs/heads/master@{#377856}
TBR=davidben@chromium.org,olli.raula@intel.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=478934
Review URL: https://codereview.chromium.org/1745133002
Cr-Commit-Position: refs/heads/master@{#378274}
Diffstat (limited to 'net/proxy/proxy_resolver.h')
-rw-r--r-- | net/proxy/proxy_resolver.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/proxy/proxy_resolver.h b/net/proxy/proxy_resolver.h index 0a85f60..81efe05 100644 --- a/net/proxy/proxy_resolver.h +++ b/net/proxy/proxy_resolver.h @@ -27,11 +27,8 @@ class ProxyInfo; // requests at a time. class NET_EXPORT_PRIVATE ProxyResolver { public: - class Request { - public: - virtual ~Request() {} // Cancels the request - virtual LoadState GetLoadState() = 0; - }; + // Opaque pointer type, to return a handle to cancel outstanding requests. + typedef void* RequestHandle; ProxyResolver() {} @@ -42,14 +39,19 @@ 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. Call request->reset() to cancel. The - // scoped_ptr<Request> must not outlive the ProxyResolver that assigned it. + // |*request| is written to, and can be passed to CancelRequest(). virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, const CompletionCallback& callback, - scoped_ptr<Request>* request, + RequestHandle* request, const BoundNetLog& 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); }; |