summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension_builder.h
diff options
context:
space:
mode:
authorlimasdf <limasdf@gmail.com>2015-12-17 17:36:16 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 01:37:16 +0000
commit704a902182dd1ba3b315563a6a65a7eb107ece79 (patch)
tree584e650445eed56fef7a5dd4693e55ed90bf56e0 /extensions/common/extension_builder.h
parenta960829376718133c93b1699a997b875e538a262 (diff)
downloadchromium_src-704a902182dd1ba3b315563a6a65a7eb107ece79.zip
chromium_src-704a902182dd1ba3b315563a6a65a7eb107ece79.tar.gz
chromium_src-704a902182dd1ba3b315563a6a65a7eb107ece79.tar.bz2
Use rvalue reference instead of ExtensionBuilder::pass()
C++ 11 enables rvalue reference with std::move() so that removing legacy ListBuilder::Pass(). BUG=563649 TBR=thankis@chromium.org Review URL: https://codereview.chromium.org/1511103003 Cr-Commit-Position: refs/heads/master@{#365969}
Diffstat (limited to 'extensions/common/extension_builder.h')
-rw-r--r--extensions/common/extension_builder.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/extensions/common/extension_builder.h b/extensions/common/extension_builder.h
index 4b40178..96c81d2 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