refactor: replace deprecated DISALLOW_COPY_AND_ASSIGN (#31633)

This commit is contained in:
Milan Burda 2021-11-03 12:41:45 +01:00 committed by GitHub
parent 2a2a1a834c
commit 65a980c673
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
231 changed files with 918 additions and 576 deletions

View file

@ -9,7 +9,6 @@
#include <utility>
#include <vector>
#include "base/macros.h"
#include "v8/include/v8.h"
namespace electron {
@ -30,6 +29,10 @@ class KeyWeakMap {
p.second.second.ClearWeak();
}
// disable copy
KeyWeakMap(const KeyWeakMap&) = delete;
KeyWeakMap& operator=(const KeyWeakMap&) = delete;
// Sets the object to WeakMap with the given |key|.
void Set(v8::Isolate* isolate, const K& key, v8::Local<v8::Object> object) {
KeyObject key_object = {key, this};
@ -78,8 +81,6 @@ class KeyWeakMap {
// Map of stored objects.
std::unordered_map<K, std::pair<KeyObject, v8::Global<v8::Object>>> map_;
DISALLOW_COPY_AND_ASSIGN(KeyWeakMap);
};
} // namespace electron