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

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: 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_v8_tracing.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31e849076e2037b7de72b82bfe5871a767fce555..10630ba1b8d93f1121bdac7203ee1ab6449fbc31 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,12 @@ void ProxyResolverV8Tracing::Job::OnDnsOperationComplete(int result) {
pending_dns_addresses_);
pending_dns_ = NULL;
+ if (!parent_->on_load_state_changed_.is_null() &&
+ !pending_dns_completed_synchronously_ && !cancelled_.IsSet()) {
+ parent_->on_load_state_changed_.Run(this,
+ LOAD_STATE_RESOLVING_PROXY_FOR_URL);
+ }
+
if (blocking_dns_) {
event_.Signal();
return;
@@ -934,11 +944,23 @@ ProxyResolverV8Tracing::ProxyResolverV8Tracing(
HostResolver* host_resolver,
ProxyResolverErrorObserver* error_observer,
NetLog* net_log)
+ : ProxyResolverV8Tracing(host_resolver,
+ error_observer,
+ net_log,
+ LoadStateChangedCallback()) {
+}
+
+ProxyResolverV8Tracing::ProxyResolverV8Tracing(
+ HostResolver* host_resolver,
+ ProxyResolverErrorObserver* error_observer,
+ NetLog* net_log,
+ const LoadStateChangedCallback& 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) {
// TODO(eroman): Remove once crbug.com/454983 is fixed.
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
« no previous file with comments | « 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