Make ProcessMap::Item non-copyable.
There's a contradictory comment about the copy constructor being
implicit, where, in reality, this was explicit. Since we
don't require Items to be copied, this CL makes Item non-copyable
instead, and provides move constructs.
Bug: None
Test: Internal only change, no visible changes expected.
Change-Id: I051a972181a3210d55745052c87bb58b8db7ef04
Reviewed-on: https://chromium-review.googlesource.com/c/1460124
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630449}
diff --git a/extensions/browser/process_map.cc b/extensions/browser/process_map.cc
index 18ada29..1928d3d5 100644
--- a/extensions/browser/process_map.cc
+++ b/extensions/browser/process_map.cc
@@ -16,16 +16,7 @@
// Item
struct ProcessMap::Item {
- Item() : process_id(0), site_instance_id(0) {
- }
-
- // Purposely implicit constructor needed on older gcc's. See:
- // http://codereview.chromium.org/8769022/
- explicit Item(const ProcessMap::Item& other)
- : extension_id(other.extension_id),
- process_id(other.process_id),
- site_instance_id(other.site_instance_id) {
- }
+ Item() {}
Item(const std::string& extension_id, int process_id,
int site_instance_id)
@@ -37,6 +28,9 @@
~Item() {
}
+ Item(ProcessMap::Item&&) = default;
+ Item& operator=(ProcessMap::Item&&) = default;
+
bool operator<(const ProcessMap::Item& other) const {
return std::tie(extension_id, process_id, site_instance_id) <
std::tie(other.extension_id, other.process_id,
@@ -44,8 +38,11 @@
}
std::string extension_id;
- int process_id;
- int site_instance_id;
+ int process_id = 0;
+ int site_instance_id = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Item);
};