summaryrefslogtreecommitdiffstats
path: root/base/values.cc
diff options
context:
space:
mode:
authorpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 16:46:55 +0000
committerpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 16:46:55 +0000
commita3a3401c6a2f051ed33a1a5242f96138479d6622 (patch)
tree710370b2057b52fa6dc33fdfe589a039b34f1282 /base/values.cc
parent2ee8bd4395aa65478efdfa14787ed40924e94e61 (diff)
downloadchromium_src-a3a3401c6a2f051ed33a1a5242f96138479d6622.zip
chromium_src-a3a3401c6a2f051ed33a1a5242f96138479d6622.tar.gz
chromium_src-a3a3401c6a2f051ed33a1a5242f96138479d6622.tar.bz2
This CL provides a general ONC signature which is used for validation and normalization.
ONCValidator checks the existence of fields and types and may be extended further checks (e.g. format of IPAddresses or URLs can be checked there too). It supports removing unknown fields. ONCNormalizer removes ignored/unnecessary fields. This new code will not be in use, yet, but prepares for further changes to the network settings. About the code organization: My idea was to put all network settings related stuff into chromeos/network_settings and thus giving up on the monolithic NetworkLibrary. In upcoming CLs, I will provide an ONC merger and a translator between ONC and Shill which will also use this signature (the Shill keys are already part of the signature). BUG=chromium:148905 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10944009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.cc')
-rw-r--r--base/values.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/values.cc b/base/values.cc
index 8453bb4..0b0eb07 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -633,6 +633,15 @@ bool DictionaryValue::GetWithoutPathExpansion(const std::string& key,
const_cast<const Value**>(out_value));
}
+bool DictionaryValue::GetBooleanWithoutPathExpansion(const std::string& key,
+ bool* out_value) const {
+ const Value* value;
+ if (!GetWithoutPathExpansion(key, &value))
+ return false;
+
+ return value->GetAsBoolean(out_value);
+}
+
bool DictionaryValue::GetIntegerWithoutPathExpansion(const std::string& key,
int* out_value) const {
const Value* value;