summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_config.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 12:44:19 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 12:44:19 +0000
commite0470bd2dd6b88f88b1e96cae90872a1b84fe265 (patch)
tree68fe6de9bc811ad6ce4237c50812ee3028510196 /net/proxy/proxy_config.h
parent82a3767c45e85b77fb41d4fc92fc49fcb879e75b (diff)
downloadchromium_src-e0470bd2dd6b88f88b1e96cae90872a1b84fe265.zip
chromium_src-e0470bd2dd6b88f88b1e96cae90872a1b84fe265.tar.gz
chromium_src-e0470bd2dd6b88f88b1e96cae90872a1b84fe265.tar.bz2
Enable (optional) blocking of webrequests in case a PAC script cannot be fetched or is invalid.
The optional blocking is currently only exposed to the Proxy Settings API, not to command-line parameters or policies. BUG=79344 TEST=Install the sample proxy extension and enter a non-existing url and a URL that does not point to a valid JavaScript file. In either case, the request should fail. Review URL: http://codereview.chromium.org/6871019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config.h')
-rw-r--r--net/proxy/proxy_config.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h
index 9012a31..dc0fd71 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.
+ bool pac_mandatory_;
+
// Manual proxy settings.
ProxyRules proxy_rules_;