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

Unified Diff: net/proxy/mojo_proxy_resolver_impl.cc

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
Index: net/proxy/mojo_proxy_resolver_impl.cc
diff --git a/net/proxy/mojo_proxy_resolver_impl.cc b/net/proxy/mojo_proxy_resolver_impl.cc
index f8362421ec71f3785d1da575b4a9983c306512f3..a35f5a7c02a4663139f6c0f5bb7eabdf8f632a12 100644
--- a/net/proxy/mojo_proxy_resolver_impl.cc
+++ b/net/proxy/mojo_proxy_resolver_impl.cc
@@ -37,7 +37,7 @@ class MojoProxyResolverImpl::Job {
interfaces::ProxyResolverRequestClientPtr client_;
ProxyInfo result_;
GURL url_;
- net::ProxyResolver::RequestHandle request_handle_;
+ std::unique_ptr<net::ProxyResolver::Request> request_;
bool done_;
DISALLOW_COPY_AND_ASSIGN(Job);
@@ -74,20 +74,15 @@ MojoProxyResolverImpl::Job::Job(
: resolver_(resolver),
client_(std::move(client)),
url_(url),
- request_handle_(nullptr),
done_(false) {}
-MojoProxyResolverImpl::Job::~Job() {
- if (request_handle_ && !done_)
- resolver_->resolver_->CancelRequest(request_handle_);
-}
+MojoProxyResolverImpl::Job::~Job() {}
void MojoProxyResolverImpl::Job::Start() {
resolver_->resolver_->GetProxyForURL(
url_, &result_, base::Bind(&Job::GetProxyDone, base::Unretained(this)),
- &request_handle_,
- base::MakeUnique<MojoProxyResolverV8TracingBindings<
- interfaces::ProxyResolverRequestClient>>(client_.get()));
+ &request_, base::MakeUnique<MojoProxyResolverV8TracingBindings<
+ interfaces::ProxyResolverRequestClient>>(client_.get()));
client_.set_connection_error_handler(base::Bind(
&MojoProxyResolverImpl::Job::OnConnectionError, base::Unretained(this)));
}
« no previous file with comments | « net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698