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

Unified Diff: base/values.cc

Issue 7745040: [Sync] Make P2PNotifier behave more like InvalidationNotifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index ad534696b389b537dc4333876c78f9a84247583a..cc2ebf625a1fafefa6701aec8b404e8894db28b6 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -133,6 +133,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;.
@@ -642,6 +650,19 @@ bool DictionaryValue::RemoveWithoutPathExpansion(const std::string& key,
return true;
}
+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;
+}
+
DictionaryValue* DictionaryValue::DeepCopyWithoutEmptyChildren() {
Value* copy = CopyWithoutEmptyChildren(this);
return copy ? static_cast<DictionaryValue*>(copy) : new DictionaryValue;

Powered by Google App Engine
This is Rietveld 408576698