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

Unified Diff: net/proxy/proxy_service.cc

Issue 940813003: Use a utility process for the Mojo v8 proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-in-process-enable
Patch Set: Address some review comments. 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
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index cd6e376be5299c05af52adcad7631eb14a38a358..4c898218aa4250119aaf4c13b41916749ac80804 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -843,6 +843,24 @@ class ProxyService::PacRequest
config_id_ = ProxyConfig::kInvalidConfigID;
config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN;
+ // If the PAC script failed fatally, it needs to be reloaded. Currently,
eroman 2015/03/11 18:48:36 This change would best be proposed as a separate c
Anand Mistry (off Chromium) 2015/03/12 05:10:22 I've removed this from this CL. So out-of-process
+ // this only applies to out-of-process proxy resolution and only happens
+ // when the process crashes.
+ if (result_code == ERR_PAC_SCRIPT_TERMINATED) {
+ VLOG(1) << "Detected PAC script terminated. Resetting proxy config.";
+ // Reset the proxy config.
+ // REVIEWERS: Should the fetched proxy config be reset?
+ service_->ResetProxyConfig(false);
+
+ // If there are any pending requests, excluding this one, re-start the
+ // config fetch/apply process.
+ size_t pending_requests = service_->NumPendingRequests();
+ if (pending_requests > 1 ||
+ (pending_requests && !service_->ContainsPendingRequest(this))) {
+ service_->ApplyProxyConfigIfAvailable();
+ }
+ }
+
return rv;
}
@@ -1338,6 +1356,10 @@ void ProxyService::RemovePendingRequest(PacRequest* req) {
pending_requests_.erase(it);
}
+size_t ProxyService::NumPendingRequests() const {
+ return pending_requests_.size();
eroman 2015/03/11 18:48:36 Not needed per discussion above.
Anand Mistry (off Chromium) 2015/03/12 05:10:22 Done.
+}
+
int ProxyService::DidFinishResolvingProxy(const GURL& url,
int load_flags,
NetworkDelegate* network_delegate,

Powered by Google App Engine
This is Rietveld 408576698