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

Unified Diff: net/proxy/proxy_resolver_mojo.cc

Issue 939503004: Add LoadState reporting to the mojo proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-resolver-mojo
Patch Set: rebase Created 5 years, 9 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.h ('k') | net/proxy/proxy_resolver_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_mojo.cc
diff --git a/net/proxy/proxy_resolver_mojo.cc b/net/proxy/proxy_resolver_mojo.cc
index 6150d154b5106b9f85dad033164a5aca5908ce13..3801d41a093cb723ab7f21b87f3326ca48ed3f0a 100644
--- a/net/proxy/proxy_resolver_mojo.cc
+++ b/net/proxy/proxy_resolver_mojo.cc
@@ -31,6 +31,9 @@ class ProxyResolverMojo::Job : public interfaces::ProxyResolverRequestClient,
// Cancels the job and prevents the callback from being run.
void Cancel();
+ // Returns the LoadState of this job.
+ LoadState load_state() { return load_state_; }
+
private:
// Overridden from mojo::ErrorHandler:
void OnConnectionError() override;
@@ -39,11 +42,13 @@ class ProxyResolverMojo::Job : public interfaces::ProxyResolverRequestClient,
void ReportResult(
int32_t error,
mojo::Array<interfaces::ProxyServerPtr> proxy_servers) override;
+ void LoadStateChanged(int32_t load_state) override;
ProxyResolverMojo* resolver_;
const GURL url_;
ProxyInfo* results_;
net::CompletionCallback callback_;
+ LoadState load_state_ = LOAD_STATE_RESOLVING_PROXY_FOR_URL;
base::ThreadChecker thread_checker_;
mojo::Binding<interfaces::ProxyResolverRequestClient> binding_;
@@ -100,6 +105,10 @@ void ProxyResolverMojo::Job::ReportResult(
resolver_->RemoveJob(this);
}
+void ProxyResolverMojo::Job::LoadStateChanged(int32_t load_state) {
+ load_state_ = static_cast<LoadState>(load_state);
+}
+
ProxyResolverMojo::ProxyResolverMojo(
MojoProxyResolverFactory* mojo_proxy_resolver_factory,
HostResolver* host_resolver)
@@ -247,8 +256,9 @@ void ProxyResolverMojo::CancelRequest(RequestHandle request) {
}
LoadState ProxyResolverMojo::GetLoadState(RequestHandle request) const {
- // TODO(amistry): Implement real LoadState.
- return LOAD_STATE_RESOLVING_PROXY_FOR_URL;
+ Job* job = static_cast<Job*>(request);
+ CHECK_EQ(1u, pending_jobs_.count(job));
+ return job->load_state();
}
} // namespace net
« no previous file with comments | « net/proxy/proxy_resolver.h ('k') | net/proxy/proxy_resolver_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698