summaryrefslogtreecommitdiffstats
path: root/base/values.cc
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-26 01:11:44 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-26 01:11:44 +0000
commit5cf906f8476ea5d718bc676e622a04ec153e95f7 (patch)
treeb37dca65e384cc7a5a86dffcf8fed12cf31c9025 /base/values.cc
parent1c669f135def144fba217cb04e2e668144bf0177 (diff)
downloadchromium_src-5cf906f8476ea5d718bc676e622a04ec153e95f7.zip
chromium_src-5cf906f8476ea5d718bc676e622a04ec153e95f7.tar.gz
chromium_src-5cf906f8476ea5d718bc676e622a04ec153e95f7.tar.bz2
Value::GetAsDictionary
BUG=none TEST=no Review URL: http://codereview.chromium.org/8701002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.cc')
-rw-r--r--base/values.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/base/values.cc b/base/values.cc
index 4719741..8d7ca35 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -143,6 +143,14 @@ bool Value::GetAsList(const ListValue** out_value) const {
return false;
}
+bool Value::GetAsDictionary(DictionaryValue** out_value) {
+ return false;
+}
+
+bool Value::GetAsDictionary(const DictionaryValue** out_value) const {
+ return false;
+}
+
Value* Value::DeepCopy() const {
// This method should only be getting called for null Values--all subclasses
// need to provide their own implementation;.
@@ -345,6 +353,18 @@ DictionaryValue::~DictionaryValue() {
Clear();
}
+bool DictionaryValue::GetAsDictionary(DictionaryValue** out_value) {
+ if (out_value)
+ *out_value = this;
+ return true;
+}
+
+bool DictionaryValue::GetAsDictionary(const DictionaryValue** out_value) const {
+ if (out_value)
+ *out_value = this;
+ return true;
+}
+
bool DictionaryValue::HasKey(const std::string& key) const {
DCHECK(IsStringUTF8(key));
ValueMap::const_iterator current_entry = dictionary_.find(key);