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

Unified Diff: extensions/common/extension_builder.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
Index: extensions/common/extension_builder.cc
diff --git a/extensions/common/extension_builder.cc b/extensions/common/extension_builder.cc
index f993e9467ac89758efc2c1e50f0fe50c82d2d4a6..b573128f16deec660570b1a74146b7a7c54538f3 100644
--- a/extensions/common/extension_builder.cc
+++ b/extensions/common/extension_builder.cc
@@ -4,6 +4,8 @@
#include "extensions/common/extension_builder.h"
+#include <utility>
+
#include "extensions/common/extension.h"
namespace extensions {
@@ -14,6 +16,22 @@ ExtensionBuilder::ExtensionBuilder()
}
ExtensionBuilder::~ExtensionBuilder() {}
+ExtensionBuilder::ExtensionBuilder(ExtensionBuilder&& other)
+ : path_(std::move(other.path_)),
+ location_(other.location_),
+ manifest_(std::move(other.manifest_)),
+ flags_(other.flags_),
+ id_(std::move(other.id_)) {}
+
+ExtensionBuilder& ExtensionBuilder::operator=(ExtensionBuilder&& other) {
+ path_ = std::move(other.path_);
+ location_ = other.location_;
+ manifest_ = std::move(other.manifest_);
+ flags_ = other.flags_;
+ id_ = std::move(other.id_);
+ return *this;
+}
+
scoped_refptr<Extension> ExtensionBuilder::Build() {
std::string error;
scoped_refptr<Extension> extension = Extension::Create(

Powered by Google App Engine
This is Rietveld 408576698