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

Unified Diff: extensions/common/test_util.cc

Issue 1511103003: Use rvalue reference instead of ExtensionBuilder::pass() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review (returning rvalue) Created 5 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
« no previous file with comments | « extensions/common/test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/test_util.cc
diff --git a/extensions/common/test_util.cc b/extensions/common/test_util.cc
index 9a9312a3fc15aaa57da75fd186bba8e64e9d29ff..c8086d6ac2a0a35e730b50edda348e6812f25fbb 100644
--- a/extensions/common/test_util.cc
+++ b/extensions/common/test_util.cc
@@ -13,16 +13,15 @@
namespace extensions {
namespace test_util {
-ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) {
- return builder
- .SetManifest(DictionaryBuilder()
- .Set("name", "Test extension")
- .Set("version", "1.0")
- .Set("manifest_version", 2));
+ExtensionBuilder BuildExtension(ExtensionBuilder builder) {
+ return std::move(builder.SetManifest(DictionaryBuilder()
danakj 2015/12/17 22:22:02 nit: it might be easier to read these if you wrote
limasdf 2015/12/18 00:31:58 Thank you. |builder| is rvalue, just returning wit
danakj 2015/12/18 00:38:49 Ah, right return will make it an rvalue :) Thanks!
+ .Set("name", "Test extension")
+ .Set("version", "1.0")
+ .Set("manifest_version", 2)));
}
-ExtensionBuilder& BuildApp(ExtensionBuilder& builder) {
- return builder.SetManifest(
+ExtensionBuilder BuildApp(ExtensionBuilder builder) {
+ return std::move(builder.SetManifest(
DictionaryBuilder()
.Set("name", "Test extension")
.Set("version", "1.0")
@@ -32,7 +31,7 @@ ExtensionBuilder& BuildApp(ExtensionBuilder& builder) {
"background",
extensions::DictionaryBuilder().Set(
"scripts", std::move(extensions::ListBuilder().Append(
- "background.js"))))));
+ "background.js")))))));
}
scoped_refptr<Extension> CreateEmptyExtension() {
« no previous file with comments | « extensions/common/test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698