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

Unified Diff: net/proxy/proxy_resolver_v8_tracing.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: Created 5 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
Index: net/proxy/proxy_resolver_v8_tracing.cc
diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
index c498f749bb6e8163a2dab165a7cf88c9dea0ddee..e94db808326ad9545e888da2e89c337070f0555c 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -707,6 +707,10 @@ void ProxyResolverV8Tracing::Job::DoDnsOperation() {
} else {
DCHECK(dns_request);
pending_dns_ = dns_request;
+ if (!parent_->on_load_state_changed_.is_null()) {
+ parent_->on_load_state_changed_.Run(
+ this, LOAD_STATE_RESOLVING_HOST_IN_PROXY_SCRIPT);
+ }
// OnDnsOperationComplete() will be called by host resolver on completion.
}
@@ -732,6 +736,11 @@ void ProxyResolverV8Tracing::Job::OnDnsOperationComplete(int result) {
pending_dns_addresses_);
pending_dns_ = NULL;
+ if (!parent_->on_load_state_changed_.is_null()) {
+ parent_->on_load_state_changed_.Run(this,
+ LOAD_STATE_RESOLVING_PROXY_FOR_URL);
eroman 2015/02/25 00:08:06 Note that OnDnsOperationComplete() is called in re
Sam McNally 2015/02/26 04:00:01 Added a check for pending_dns_completed_synchronou
+ }
+
if (blocking_dns_) {
event_.Signal();
return;
@@ -934,11 +943,23 @@ ProxyResolverV8Tracing::ProxyResolverV8Tracing(
HostResolver* host_resolver,
ProxyResolverErrorObserver* error_observer,
NetLog* net_log)
+ : ProxyResolverV8Tracing(host_resolver,
+ error_observer,
+ net_log,
+ LoadStateChangedCallback<RequestHandle>()) {
+}
+
+ProxyResolverV8Tracing::ProxyResolverV8Tracing(
+ HostResolver* host_resolver,
+ ProxyResolverErrorObserver* error_observer,
+ NetLog* net_log,
+ const LoadStateChangedCallback<RequestHandle>& on_load_state_changed)
: ProxyResolver(true /*expects_pac_bytes*/),
host_resolver_(host_resolver),
error_observer_(error_observer),
net_log_(net_log),
- num_outstanding_callbacks_(0) {
+ num_outstanding_callbacks_(0),
+ on_load_state_changed_(on_load_state_changed) {
DCHECK(host_resolver);
// Start up the thread.
thread_.reset(new base::Thread("Proxy resolver"));
« net/proxy/mojo_proxy_resolver_impl_unittest.cc ('K') | « net/proxy/proxy_resolver_v8_tracing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698