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

Unified Diff: net/proxy/proxy_resolver_factory_mojo_unittest.cc

Issue 1439053002: Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore scoped_ptr to mock and nits Created 4 years, 10 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/proxy_resolver_factory_mojo.cc ('k') | net/proxy/proxy_resolver_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_factory_mojo_unittest.cc
diff --git a/net/proxy/proxy_resolver_factory_mojo_unittest.cc b/net/proxy/proxy_resolver_factory_mojo_unittest.cc
index 9fa4ef587ec2d3dad784454ad2538e90f8127136..0830609004172e481d7f9f7cedff8fc5c07c2497 100644
--- a/net/proxy/proxy_resolver_factory_mojo_unittest.cc
+++ b/net/proxy/proxy_resolver_factory_mojo_unittest.cc
@@ -294,14 +294,14 @@ class Request {
int WaitForResult();
const ProxyInfo& results() const { return results_; }
- LoadState load_state() { return resolver_->GetLoadState(handle_); }
+ LoadState load_state() { return request_->GetLoadState(); }
BoundTestNetLog& net_log() { return net_log_; }
private:
ProxyResolver* resolver_;
const GURL url_;
ProxyInfo results_;
- ProxyResolver::RequestHandle handle_;
+ scoped_ptr<ProxyResolver::Request> request_;
int error_;
TestCompletionCallback callback_;
BoundTestNetLog net_log_;
@@ -313,12 +313,12 @@ Request::Request(ProxyResolver* resolver, const GURL& url)
int Request::Resolve() {
error_ = resolver_->GetProxyForURL(url_, &results_, callback_.callback(),
- &handle_, net_log_.bound());
+ &request_, net_log_.bound());
return error_;
}
void Request::Cancel() {
- resolver_->CancelRequest(handle_);
+ request_.reset();
}
int Request::WaitForResult() {
@@ -841,7 +841,7 @@ TEST_F(ProxyResolverFactoryMojoTest, GetProxyForURL_DeleteInCallback) {
ProxyInfo results;
TestCompletionCallback callback;
- ProxyResolver::RequestHandle handle;
+ scoped_ptr<ProxyResolver::Request> request;
BoundNetLog net_log;
EXPECT_EQ(
OK,
@@ -849,7 +849,7 @@ TEST_F(ProxyResolverFactoryMojoTest, GetProxyForURL_DeleteInCallback) {
GURL(kExampleUrl), &results,
base::Bind(&ProxyResolverFactoryMojoTest::DeleteProxyResolverCallback,
base::Unretained(this), callback.callback()),
- &handle, net_log)));
+ &request, net_log)));
on_delete_callback_.WaitForResult();
}
@@ -861,7 +861,7 @@ TEST_F(ProxyResolverFactoryMojoTest,
ProxyInfo results;
TestCompletionCallback callback;
- ProxyResolver::RequestHandle handle;
+ scoped_ptr<ProxyResolver::Request> request;
BoundNetLog net_log;
EXPECT_EQ(
ERR_PAC_SCRIPT_TERMINATED,
@@ -869,7 +869,7 @@ TEST_F(ProxyResolverFactoryMojoTest,
GURL(kExampleUrl), &results,
base::Bind(&ProxyResolverFactoryMojoTest::DeleteProxyResolverCallback,
base::Unretained(this), callback.callback()),
- &handle, net_log)));
+ &request, net_log)));
on_delete_callback_.WaitForResult();
}
« no previous file with comments | « net/proxy/proxy_resolver_factory_mojo.cc ('k') | net/proxy/proxy_resolver_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698