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

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 review comments. 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_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 6dd1b5014ec896abc49a706cb721ce1ae655918f..97b315c92eae22697eecb91b7588f406499f5d0d 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -827,6 +827,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,
+ // 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;
}
@@ -1326,6 +1344,10 @@ void ProxyService::RemovePendingRequest(PacRequest* req) {
pending_requests_.erase(it);
}
+size_t ProxyService::NumPendingRequests() const {
+ return pending_requests_.size();
+}
+
int ProxyService::DidFinishResolvingProxy(const GURL& url,
int load_flags,
NetworkDelegate* network_delegate,

Powered by Google App Engine
This is Rietveld 408576698