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

Unified Diff: extensions/common/extension_builder.h

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
Index: extensions/common/extension_builder.h
diff --git a/extensions/common/extension_builder.h b/extensions/common/extension_builder.h
index 4b40178b9b71b790ce00bcae139e97d4850f1ec2..96c81d2b6d8735771a5ac04b92a6b3063c6a6e56 100644
--- a/extensions/common/extension_builder.h
+++ b/extensions/common/extension_builder.h
@@ -24,14 +24,14 @@ class ExtensionBuilder {
ExtensionBuilder();
~ExtensionBuilder();
+ // Move constructor and operator=.
+ ExtensionBuilder(ExtensionBuilder&& other);
+ ExtensionBuilder& operator=(ExtensionBuilder&& other);
+
// Can only be called once, after which it's invalid to use the builder.
// CHECKs that the extension was created successfully.
scoped_refptr<Extension> Build();
- // Workaround to allow you to pass rvalue ExtensionBuilders by reference to
- // other functions, e.g. UseBuilder(ExtensionBuilder().Pass())
- ExtensionBuilder& Pass() { return *this; }
-
// Defaults to FilePath().
ExtensionBuilder& SetPath(const base::FilePath& path);
@@ -58,6 +58,8 @@ class ExtensionBuilder {
scoped_ptr<base::DictionaryValue> manifest_;
int flags_;
std::string id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionBuilder);
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698