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

Unified Diff: net/proxy/proxy_config.cc

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
« no previous file with comments | « net/proxy/proxy_config.h ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config.cc
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 70e6549a794def718c815d5581eb917c8bc69250..42589a9a8727cf84437ba520685109dd666a7bfb 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -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.
@@ -158,12 +158,14 @@ ProxyServer* ProxyConfig::ProxyRules::MapUrlSchemeToProxyNoFallback(
return NULL; // No mapping for this scheme.
}
-ProxyConfig::ProxyConfig() : auto_detect_(false), id_(INVALID_ID) {
+ProxyConfig::ProxyConfig()
+ : auto_detect_(false), pac_mandatory_(false), id_(INVALID_ID) {
}
ProxyConfig::ProxyConfig(const ProxyConfig& config)
: auto_detect_(config.auto_detect_),
pac_url_(config.pac_url_),
+ pac_mandatory_(config.pac_mandatory_),
proxy_rules_(config.proxy_rules_),
id_(config.id_) {
}
@@ -174,6 +176,7 @@ ProxyConfig::~ProxyConfig() {
ProxyConfig& ProxyConfig::operator=(const ProxyConfig& config) {
auto_detect_ = config.auto_detect_;
pac_url_ = config.pac_url_;
+ pac_mandatory_ = config.pac_mandatory_;
proxy_rules_ = config.proxy_rules_;
id_ = config.id_;
return *this;
@@ -184,6 +187,7 @@ bool ProxyConfig::Equals(const ProxyConfig& other) const {
// have the same settings.
return auto_detect_ == other.auto_detect_ &&
pac_url_ == other.pac_url_ &&
+ pac_mandatory_ == other.pac_mandatory_ &&
proxy_rules_.Equals(other.proxy_rules());
}
@@ -202,8 +206,11 @@ Value* ProxyConfig::ToValue() const {
// Output the automatic settings.
if (auto_detect_)
dict->SetBoolean("auto_detect", auto_detect_);
- if (has_pac_url())
+ if (has_pac_url()) {
dict->SetString("pac_url", pac_url_.possibly_invalid_spec());
+ if (pac_mandatory_)
+ dict->SetBoolean("pac_mandatory", pac_mandatory_);
+ }
// Output the manual settings.
if (proxy_rules_.type != ProxyRules::TYPE_NO_RULES) {
@@ -246,4 +253,3 @@ Value* ProxyConfig::ToValue() const {
}
} // namespace net
-
« no previous file with comments | « net/proxy/proxy_config.h ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698