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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp

Issue 2897603003: Get and return String by const-ref if used as rvalue (Closed)
Patch Set: Created 3 years, 7 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: third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
index 6d28652395e344a449f6653799531fad9c18fd5b..e1e94a5ca4942d8885d5a4487ae3fc3228b7f64e 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
@@ -19,18 +19,18 @@ namespace blink {
UnrestrictedDoubleOrString::UnrestrictedDoubleOrString() : m_type(SpecificTypeNone) {}
-String UnrestrictedDoubleOrString::getAsString() const {
+const String& UnrestrictedDoubleOrString::getAsString() const {
DCHECK(isString());
return m_string;
}
-void UnrestrictedDoubleOrString::setString(String value) {
+void UnrestrictedDoubleOrString::setString(const String& value) {
DCHECK(isNull());
m_string = value;
m_type = SpecificTypeString;
}
-UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromString(String value) {
+UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromString(const String& value) {
UnrestrictedDoubleOrString container;
container.setString(value);
return container;

Powered by Google App Engine
This is Rietveld 408576698