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

Unified Diff: base/values.cc

Issue 148463003: libaddressinput - reduce number of copies in storage class by 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 6 years, 11 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 6068556bb3d1a4738b0048c118577a8670aef6be..8a1b365d88616a0e7172e79fb0a35b34586041c0 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -134,6 +134,10 @@ bool Value::GetAsString(string16* out_value) const {
return false;
}
+bool Value::GetAsString(const StringValue** out_value) const {
+ return false;
+}
+
bool Value::GetAsList(ListValue** out_value) {
return false;
}
@@ -278,6 +282,14 @@ StringValue::StringValue(const string16& in_value)
StringValue::~StringValue() {
}
+std::string* StringValue::GetString() {
+ return &value_;
+}
+
+const std::string& StringValue::GetString() const {
+ return value_;
+}
+
bool StringValue::GetAsString(std::string* out_value) const {
if (out_value)
*out_value = value_;
@@ -290,6 +302,12 @@ bool StringValue::GetAsString(string16* out_value) const {
return true;
}
+bool StringValue::GetAsString(const StringValue** out_value) const {
+ if (*out_value)
+ *out_value = this;
+ return true;
+}
+
StringValue* StringValue::DeepCopy() const {
return CreateStringValue(value_);
}

Powered by Google App Engine
This is Rietveld 408576698