Replace DISALLOW_COPY_AND_ASSIGN in net/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: Ie30b152cdd5d493c5b2ecd96d13d789c18123f2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3174408
Auto-Submit: Peter Boström <[email protected]>
Commit-Queue: Daniel Cheng <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Owners-Override: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923926}
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index d8fea66..4201c684 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -546,6 +546,9 @@
explicit TestConnectJobFactory(MockClientSocketFactory* client_socket_factory)
: client_socket_factory_(client_socket_factory) {}
+ TestConnectJobFactory(const TestConnectJobFactory&) = delete;
+ TestConnectJobFactory& operator=(const TestConnectJobFactory&) = delete;
+
~TestConnectJobFactory() override = default;
void set_job_type(TestConnectJob::JobType job_type) { job_type_ = job_type; }
@@ -592,8 +595,6 @@
std::list<TestConnectJob::JobType>* job_types_ = nullptr;
base::TimeDelta timeout_duration_;
MockClientSocketFactory* const client_socket_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(TestConnectJobFactory);
};
} // namespace
@@ -3022,6 +3023,9 @@
TransportClientSocketPool* pool)
: group_id_(group_id), params_(params), pool_(pool) {}
+ ConnectWithinCallback(const ConnectWithinCallback&) = delete;
+ ConnectWithinCallback& operator=(const ConnectWithinCallback&) = delete;
+
~ConnectWithinCallback() override = default;
int WaitForNestedResult() {
@@ -3050,8 +3054,6 @@
TransportClientSocketPool* const pool_;
ClientSocketHandle handle_;
TestCompletionCallback nested_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ConnectWithinCallback);
};
TEST_F(ClientSocketPoolBaseTest, AbortAllRequestsOnFlush) {
@@ -5153,6 +5155,10 @@
class TestAuthHelper {
public:
TestAuthHelper() = default;
+
+ TestAuthHelper(const TestAuthHelper&) = delete;
+ TestAuthHelper& operator=(const TestAuthHelper&) = delete;
+
~TestAuthHelper() = default;
void InitHandle(
@@ -5242,8 +5248,6 @@
ClientSocketHandle handle_;
int auth_count_ = 0;
TestCompletionCallback callback_;
-
- DISALLOW_COPY_AND_ASSIGN(TestAuthHelper);
};
TEST_F(ClientSocketPoolBaseTest, ProxyAuthOnce) {