Replace DISALLOW_COPY_AND_ASSIGN in chrome/

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: I882202fb6295332b52c34ba12fae4705276b0b5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3165772
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@{#922479}
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 8a72b51..e7cc3c5 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -53,6 +53,9 @@
     DPCHECK(result == WAIT_OBJECT_0) << "Result = " << result;
   }
 
+  AutoLockMutex(const AutoLockMutex&) = delete;
+  AutoLockMutex& operator=(const AutoLockMutex&) = delete;
+
   ~AutoLockMutex() {
     BOOL released = ::ReleaseMutex(mutex_);
     DPCHECK(released);
@@ -60,7 +63,6 @@
 
  private:
   HANDLE mutex_;
-  DISALLOW_COPY_AND_ASSIGN(AutoLockMutex);
 };
 
 // A helper class that releases the given |mutex| while the AutoUnlockMutex is
@@ -72,6 +74,9 @@
     DPCHECK(released);
   }
 
+  AutoUnlockMutex(const AutoUnlockMutex&) = delete;
+  AutoUnlockMutex& operator=(const AutoUnlockMutex&) = delete;
+
   ~AutoUnlockMutex() {
     DWORD result = ::WaitForSingleObject(mutex_, INFINITE);
     DPCHECK(result == WAIT_OBJECT_0) << "Result = " << result;
@@ -79,7 +84,6 @@
 
  private:
   HANDLE mutex_;
-  DISALLOW_COPY_AND_ASSIGN(AutoUnlockMutex);
 };
 
 // Checks the visibility of the enumerated window and signals once a visible