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

Unified Diff: net/proxy/proxy_resolver_factory_mojo.cc

Issue 2430953004: Merge ProxyResolverMojo::Job and ProxyResolverMojo::RequestImpl (Closed)
Patch Set: nits 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_factory_mojo.cc
diff --git a/net/proxy/proxy_resolver_factory_mojo.cc b/net/proxy/proxy_resolver_factory_mojo.cc
index f328db932651fa6d3519549f0a15faf0ff8deb49..948328bca58ac740e93c035e8aff575bd6d651f5 100644
--- a/net/proxy/proxy_resolver_factory_mojo.cc
+++ b/net/proxy/proxy_resolver_factory_mojo.cc
@@ -129,7 +129,6 @@ class ProxyResolverMojo : public ProxyResolver {
private:
class Job;
- class RequestImpl;
base::ThreadChecker thread_checker_;
@@ -150,22 +149,9 @@ class ProxyResolverMojo : public ProxyResolver {
DISALLOW_COPY_AND_ASSIGN(ProxyResolverMojo);
};
-class ProxyResolverMojo::RequestImpl : public ProxyResolver::Request {
- public:
- explicit RequestImpl(std::unique_ptr<Job> job);
-
- ~RequestImpl() override {}
-
- LoadState GetLoadState() override;
-
- private:
- std::unique_ptr<Job> job_;
-
- DISALLOW_COPY_AND_ASSIGN(RequestImpl);
-};
-
class ProxyResolverMojo::Job
- : public ClientMixin<interfaces::ProxyResolverRequestClient> {
+ : public ProxyResolver::Request,
+ public ClientMixin<interfaces::ProxyResolverRequestClient> {
public:
Job(ProxyResolverMojo* resolver,
const GURL& url,
@@ -175,7 +161,7 @@ class ProxyResolverMojo::Job
~Job() override;
// Returns the LoadState of this job.
- LoadState GetLoadState();
+ LoadState GetLoadState() override;
private:
// Mojo error handler.
@@ -197,13 +183,6 @@ class ProxyResolverMojo::Job
DISALLOW_COPY_AND_ASSIGN(Job);
};
-ProxyResolverMojo::RequestImpl::RequestImpl(std::unique_ptr<Job> job)
- : job_(std::move(job)) {}
-
-LoadState ProxyResolverMojo::RequestImpl::GetLoadState() {
- return job_->GetLoadState();
-}
-
ProxyResolverMojo::Job::Job(ProxyResolverMojo* resolver,
const GURL& url,
ProxyInfo* results,
@@ -294,8 +273,7 @@ int ProxyResolverMojo::GetProxyForURL(const GURL& url,
if (!mojo_proxy_resolver_ptr_)
return ERR_PAC_SCRIPT_TERMINATED;
- std::unique_ptr<Job> job(new Job(this, url, results, callback, net_log));
- request->reset(new RequestImpl(std::move(job)));
+ *request = base::MakeUnique<Job>(this, url, results, callback, net_log);
return ERR_IO_PENDING;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698