[cleanup][init] Remove uses of DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: I80b7c54e44f2fc0cdc4d9786b58aaa92de519b04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567536
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71517}
This commit is contained in:
Zhi An Ng 2020-12-01 07:31:00 +00:00 committed by Commit Bot
parent 61741d6295
commit 277f4dc272
3 changed files with 11 additions and 8 deletions

View File

@ -247,13 +247,14 @@ class Genesis {
class ExtensionStates { class ExtensionStates {
public: public:
ExtensionStates(); ExtensionStates();
ExtensionStates(const ExtensionStates&) = delete;
ExtensionStates& operator=(const ExtensionStates&) = delete;
ExtensionTraversalState get_state(RegisteredExtension* extension); ExtensionTraversalState get_state(RegisteredExtension* extension);
void set_state(RegisteredExtension* extension, void set_state(RegisteredExtension* extension,
ExtensionTraversalState state); ExtensionTraversalState state);
private: private:
base::HashMap map_; base::HashMap map_;
DISALLOW_COPY_AND_ASSIGN(ExtensionStates);
}; };
// Used both for deserialized and from-scratch contexts to add the extensions // Used both for deserialized and from-scratch contexts to add the extensions

View File

@ -19,6 +19,8 @@ namespace internal {
class SourceCodeCache final { class SourceCodeCache final {
public: public:
explicit SourceCodeCache(Script::Type type) : type_(type) {} explicit SourceCodeCache(Script::Type type) : type_(type) {}
SourceCodeCache(const SourceCodeCache&) = delete;
SourceCodeCache& operator=(const SourceCodeCache&) = delete;
void Initialize(Isolate* isolate, bool create_heap_objects); void Initialize(Isolate* isolate, bool create_heap_objects);
@ -33,13 +35,15 @@ class SourceCodeCache final {
private: private:
Script::Type type_; Script::Type type_;
FixedArray cache_; FixedArray cache_;
DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
}; };
// The Boostrapper is the public interface for creating a JavaScript global // The Boostrapper is the public interface for creating a JavaScript global
// context. // context.
class Bootstrapper final { class Bootstrapper final {
public: public:
Bootstrapper(const Bootstrapper&) = delete;
Bootstrapper& operator=(const Bootstrapper&) = delete;
static void InitializeOncePerProcess(); static void InitializeOncePerProcess();
// Requires: Heap::SetUp has been called. // Requires: Heap::SetUp has been called.
@ -108,8 +112,6 @@ class Bootstrapper final {
friend class NativesExternalStringResource; friend class NativesExternalStringResource;
explicit Bootstrapper(Isolate* isolate); explicit Bootstrapper(Isolate* isolate);
DISALLOW_COPY_AND_ASSIGN(Bootstrapper);
}; };
class BootstrapperActive final { class BootstrapperActive final {
@ -118,13 +120,13 @@ class BootstrapperActive final {
: bootstrapper_(bootstrapper) { : bootstrapper_(bootstrapper) {
++bootstrapper_->nesting_; ++bootstrapper_->nesting_;
} }
BootstrapperActive(const BootstrapperActive&) = delete;
BootstrapperActive& operator=(const BootstrapperActive&) = delete;
~BootstrapperActive() { --bootstrapper_->nesting_; } ~BootstrapperActive() { --bootstrapper_->nesting_; }
private: private:
Bootstrapper* bootstrapper_; Bootstrapper* bootstrapper_;
DISALLOW_COPY_AND_ASSIGN(BootstrapperActive);
}; };
} // namespace internal } // namespace internal

View File

@ -37,6 +37,8 @@ class V8_EXPORT_PRIVATE IsolateAllocator final {
public: public:
IsolateAllocator(); IsolateAllocator();
~IsolateAllocator(); ~IsolateAllocator();
IsolateAllocator(const IsolateAllocator&) = delete;
IsolateAllocator& operator=(const IsolateAllocator&) = delete;
void* isolate_memory() const { return isolate_memory_; } void* isolate_memory() const { return isolate_memory_; }
@ -51,8 +53,6 @@ class V8_EXPORT_PRIVATE IsolateAllocator final {
v8::PageAllocator* page_allocator_ = nullptr; v8::PageAllocator* page_allocator_ = nullptr;
std::unique_ptr<base::BoundedPageAllocator> page_allocator_instance_; std::unique_ptr<base::BoundedPageAllocator> page_allocator_instance_;
VirtualMemory reservation_; VirtualMemory reservation_;
DISALLOW_COPY_AND_ASSIGN(IsolateAllocator);
}; };
} // namespace internal } // namespace internal