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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.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/XMLHttpRequestOrString.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp
index 8d0d7a0ed4c46f922b9c4ce27c03a8a3f2831598..ef2b17ec2fc79a6592a55fd4a74a412f554f8d58 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp
@@ -20,18 +20,18 @@ namespace blink {
XMLHttpRequestOrString::XMLHttpRequestOrString() : m_type(SpecificTypeNone) {}
-String XMLHttpRequestOrString::getAsString() const {
+const String& XMLHttpRequestOrString::getAsString() const {
DCHECK(isString());
return m_string;
}
-void XMLHttpRequestOrString::setString(String value) {
+void XMLHttpRequestOrString::setString(const String& value) {
DCHECK(isNull());
m_string = value;
m_type = SpecificTypeString;
}
-XMLHttpRequestOrString XMLHttpRequestOrString::fromString(String value) {
+XMLHttpRequestOrString XMLHttpRequestOrString::fromString(const String& value) {
XMLHttpRequestOrString container;
container.setString(value);
return container;

Powered by Google App Engine
This is Rietveld 408576698