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

@ -7,7 +7,6 @@
#include <memory>
#include "base/macros.h"
#include "v8/include/v8.h"
namespace gin_helper {
@ -18,6 +17,10 @@ class Locker {
explicit Locker(v8::Isolate* isolate);
~Locker();
// disable copy
Locker(const Locker&) = delete;
Locker& operator=(const Locker&) = delete;
// Returns whether current process is browser process, currently we detect it
// by checking whether current has used V8 Lock, but it might be a bad idea.
static inline bool IsBrowserProcess() { return v8::Locker::IsActive(); }
@ -27,8 +30,6 @@ class Locker {
void operator delete(void*, size_t);
std::unique_ptr<v8::Locker> locker_;
DISALLOW_COPY_AND_ASSIGN(Locker);
};
} // namespace gin_helper