summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 19:01:14 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 19:01:14 +0000
commit24f49bd3da572b7c94a5b66b60e49a0685a9912c (patch)
tree4e26e6721b527688c5ef60bcf647ea0469eacadc /net
parent489c42f10efb599a2a2f1c7adfb8fef8778bf47f (diff)
downloadchromium_src-24f49bd3da572b7c94a5b66b60e49a0685a9912c.zip
chromium_src-24f49bd3da572b7c94a5b66b60e49a0685a9912c.tar.gz
chromium_src-24f49bd3da572b7c94a5b66b60e49a0685a9912c.tar.bz2
Convert CrOS proxy config serialization to protobuf format.
BUG=chromium-os:14214 TEST=manual, and suite_Smoke Review URL: http://codereview.chromium.org/6873051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/proxy/proxy_bypass_rules.cc13
-rw-r--r--net/proxy/proxy_bypass_rules.h6
2 files changed, 17 insertions, 2 deletions
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index 91c6f44..dde3d8f 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.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.
@@ -219,6 +219,17 @@ bool ProxyBypassRules::AddRuleFromStringUsingSuffixMatching(
return AddRuleFromStringInternalWithLogging(raw, true);
}
+std::string ProxyBypassRules::ToString() const {
+ std::string result;
+ for (RuleList::const_iterator rule(rules_.begin());
+ rule != rules_.end();
+ ++rule) {
+ result += (*rule)->ToString();
+ result += ";";
+ }
+ return result;
+}
+
void ProxyBypassRules::Clear() {
STLDeleteElements(&rules_);
}
diff --git a/net/proxy/proxy_bypass_rules.h b/net/proxy/proxy_bypass_rules.h
index ad8afdc..c0f5df3 100644
--- a/net/proxy/proxy_bypass_rules.h
+++ b/net/proxy/proxy_bypass_rules.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.
@@ -153,6 +153,10 @@ class ProxyBypassRules {
// NOTE: Use AddRuleFromString() unless you truly need this behavior.
bool AddRuleFromStringUsingSuffixMatching(const std::string& raw);
+ // Converts the rules to string representation. Inverse operation to
+ // ParseFromString().
+ std::string ToString() const;
+
// Removes all the rules.
void Clear();