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

Unified Diff: base/values.cc

Issue 8701002: Value::GetAsDictionary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pacify clang Created 9 years, 1 month 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 | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index 4719741a12cccabbb05e3af138baa01167ee8b3a..8d7ca351d1e9cc6db28489f822a9f341906f04b5 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);
« no previous file with comments | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698