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

Unified Diff: base/values.cc

Issue 2577563002: Add struct traits for base::Value. (Closed)
Patch Set: Created 4 years 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 fd0bbe17a41468da40b3e55bc64c50ef3be5415d..ca3692deccae32ff401b99ac35487db78dc66199 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -118,6 +118,10 @@ bool Value::GetAsString(const StringValue** out_value) const {
return false;
}
+bool Value::GetAsString(StringPiece* out_value) const {
+ return false;
+}
+
bool Value::GetAsList(ListValue** out_value) {
return false;
}
@@ -287,6 +291,12 @@ bool StringValue::GetAsString(const StringValue** out_value) const {
return true;
}
+bool StringValue::GetAsString(StringPiece* out_value) const {
+ if (out_value)
+ *out_value = value_;
+ return true;
+}
+
StringValue* StringValue::DeepCopy() const {
return new StringValue(value_);
}

Powered by Google App Engine
This is Rietveld 408576698