Deprecate DISALLOW_COPY_AND_ASSIGN.
Chromium has decided to follow Google C++ styleguide (crbug/1010217)
when it comes to deleting implicit copy constructors and assign
operators, and will deprecate DISALLOW_COPY_AND_ASSIGN in favor of
manually deleted constructor in public.
This CL changes DISALLOW_COPY_AND_ASSIGN to deleted constructor, and
tries to move it to the right place.
This script tries to locate the constructor, and move deleted
constructor nearby (and optimistically assumes it is public). If not
found, it tries to move the lines below `public:`.
camera is excluded since it has external style code and will be handled
manually later.
Script used is at Idfe5d64ffb1fdbf53f00cf76ff63cd1e66ba934b
BUG=chromium:1144735
TEST=CQ
Exempt-From-Owner-Approval: Mechanical change involving a lot of owners.
Change-Id: I91c772eb49db979c0cd0773d090c3e4527874cc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2526882
Tested-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Qijiang Fan <fqj@google.com>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Miriam Zimmerman <mutexlox@chromium.org>
diff --git a/patchpanel/subnet.h b/patchpanel/subnet.h
index f8988b9..733e2da 100644
--- a/patchpanel/subnet.h
+++ b/patchpanel/subnet.h
@@ -29,6 +29,9 @@
SubnetAddress(uint32_t addr,
uint32_t prefix_length,
base::Closure release_cb);
+ SubnetAddress(const SubnetAddress&) = delete;
+ SubnetAddress& operator=(const SubnetAddress&) = delete;
+
~SubnetAddress();
// Returns this address in network-byte order.
@@ -53,8 +56,6 @@
// Callback to run when this object is destroyed.
base::Closure release_cb_;
-
- DISALLOW_COPY_AND_ASSIGN(SubnetAddress);
};
// Represents an allocated IPv4 subnet.
@@ -65,6 +66,9 @@
// destructor of this class and can be used to free other resources associated
// with the subnet.
Subnet(uint32_t base_addr, uint32_t prefix_length, base::Closure release_cb);
+ Subnet(const Subnet&) = delete;
+ Subnet& operator=(const Subnet&) = delete;
+
~Subnet();
// Marks |addr| as allocated. |addr| must be in network-byte order. Returns
@@ -120,8 +124,6 @@
base::Closure release_cb_;
base::WeakPtrFactory<Subnet> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(Subnet);
};
} // namespace patchpanel