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

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, 10 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
« no previous file with comments | « base/values.h ('k') | third_party/libaddressinput/chromium/chrome_storage_impl.h » ('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 fa256aade3d9cdc1b096d8ed571268d4c86ba2ef..5c0b3a20f38542de5efe5a2f2879694be68c439a 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 new StringValue(value_);
}
« no previous file with comments | « base/values.h ('k') | third_party/libaddressinput/chromium/chrome_storage_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698