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

Unified Diff: net/proxy/proxy_config.h

Issue 6871019: Enable (optional) blocking of webrequests in case a PAC script cannot be fetched or is invalid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 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
Index: net/proxy/proxy_config.h
diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h
index 9012a316652ef3f1b2161d398dacc1b45c551a80..4a2ee5c49888798f4a881a2f532dff664e1df8c7 100644
--- a/net/proxy/proxy_config.h
+++ b/net/proxy/proxy_config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -148,6 +148,14 @@ class ProxyConfig {
return pac_url_;
}
+ void set_pac_mandatory(bool enable_pac_mandatory) {
+ pac_mandatory_ = enable_pac_mandatory;
+ }
+
+ bool pac_mandatory() const {
+ return pac_mandatory_;
+ }
+
bool has_pac_url() const {
return pac_url_.is_valid();
}
@@ -175,6 +183,8 @@ class ProxyConfig {
static ProxyConfig CreateFromCustomPacURL(const GURL& pac_url) {
ProxyConfig config;
config.set_pac_url(pac_url);
+ // By default fall back to direct connection in case PAC script fails.
+ config.set_pac_mandatory(false);
return config;
}
@@ -185,6 +195,10 @@ class ProxyConfig {
// If non-empty, indicates the URL of the proxy auto-config file to use.
GURL pac_url_;
+ // If true, blocks all traffic in case fetching the pac script from |pac_url_|
+ // fails. Only valid if pac_url_ is non-empty.
eroman 2011/05/03 09:45:24 minor nit: enclose enclose "pac_url_" as in |pac_u
battre 2011/05/03 09:55:14 Done.
+ bool pac_mandatory_;
+
// Manual proxy settings.
ProxyRules proxy_rules_;
« no previous file with comments | « net/base/net_error_list.h ('k') | net/proxy/proxy_config.cc » ('j') | net/proxy/proxy_config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698