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

Unified Diff: net/proxy/proxy_service.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 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_script_decider_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 79a21c99f0dcba102a5ec7d0be1a45e196d8edc4..f55561d60a9060cd000a854e3d5bbd977379d9f6 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -868,6 +868,10 @@ class ProxyService::PacRequest
int QueryDidComplete(int result_code) {
DCHECK(!was_cancelled());
+ // Clear |resolve_job_| so is_started() returns false while
+ // DidFinishResolvingProxy() runs.
+ resolve_job_ = nullptr;
+
// Note that DidFinishResolvingProxy might modify |results_|.
int rv = service_->DidFinishResolvingProxy(url_, load_flags_,
network_delegate_, results_,
@@ -882,7 +886,6 @@ class ProxyService::PacRequest
results_->proxy_resolve_end_time_ = TimeTicks::Now();
// Reset the state associated with in-progress-resolve.
- resolve_job_ = NULL;
config_id_ = ProxyConfig::kInvalidConfigID;
config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN;
@@ -1399,6 +1402,7 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
net_log.AddEventWithNetErrorCode(
NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, result_code);
+ bool reset_config = result_code == ERR_PAC_SCRIPT_TERMINATED;
if (!config_.pac_mandatory()) {
// Fall-back to direct when the proxy resolver fails. This corresponds
// with a javascript runtime error in the PAC script.
@@ -1417,6 +1421,14 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
} else {
result_code = ERR_MANDATORY_PROXY_CONFIGURATION_FAILED;
}
+ if (reset_config) {
+ ResetProxyConfig(false);
+ // If the ProxyResolver crashed, force it to be re-initialized for the
+ // next request by resetting the proxy config. If there are other pending
+ // requests, trigger the recreation immediately so those requests retry.
+ if (pending_requests_.size() > 1)
+ ApplyProxyConfigIfAvailable();
+ }
}
net_log.EndEvent(NetLog::TYPE_PROXY_SERVICE);
« no previous file with comments | « net/proxy/proxy_script_decider_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698