Commit b8761260 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{common,unittests}

Bug: v8:11074
Change-Id: I7b34b6a647bf9ad317bdb97a344739302f892957
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2519184Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70997}
parent 62eb0019
...@@ -44,6 +44,9 @@ using ControlTransferMap = ZoneMap<pc_t, ControlTransferEntry>; ...@@ -44,6 +44,9 @@ using ControlTransferMap = ZoneMap<pc_t, ControlTransferEntry>;
// An interpreter capable of executing WebAssembly. // An interpreter capable of executing WebAssembly.
class WasmInterpreter { class WasmInterpreter {
public: public:
WasmInterpreter(const WasmInterpreter&) = delete;
WasmInterpreter& operator=(const WasmInterpreter&) = delete;
// State machine for the interpreter: // State machine for the interpreter:
// +----------------------------------------------------------+ // +----------------------------------------------------------+
// | +--------Run()/Step()---------+ | // | +--------Run()/Step()---------+ |
...@@ -104,8 +107,6 @@ class WasmInterpreter { ...@@ -104,8 +107,6 @@ class WasmInterpreter {
private: private:
Zone zone_; Zone zone_;
std::unique_ptr<WasmInterpreterInternals> internals_; std::unique_ptr<WasmInterpreterInternals> internals_;
DISALLOW_COPY_AND_ASSIGN(WasmInterpreter);
}; };
} // namespace wasm } // namespace wasm
......
...@@ -25,6 +25,8 @@ class MemoryPressureTask : public v8::Task { ...@@ -25,6 +25,8 @@ class MemoryPressureTask : public v8::Task {
MemoryPressureTask(Isolate* isolate, base::Semaphore* semaphore) MemoryPressureTask(Isolate* isolate, base::Semaphore* semaphore)
: isolate_(isolate), semaphore_(semaphore) {} : isolate_(isolate), semaphore_(semaphore) {}
~MemoryPressureTask() override = default; ~MemoryPressureTask() override = default;
MemoryPressureTask(const MemoryPressureTask&) = delete;
MemoryPressureTask& operator=(const MemoryPressureTask&) = delete;
// v8::Task implementation. // v8::Task implementation.
void Run() override { void Run() override {
...@@ -35,8 +37,6 @@ class MemoryPressureTask : public v8::Task { ...@@ -35,8 +37,6 @@ class MemoryPressureTask : public v8::Task {
private: private:
Isolate* isolate_; Isolate* isolate_;
base::Semaphore* semaphore_; base::Semaphore* semaphore_;
DISALLOW_COPY_AND_ASSIGN(MemoryPressureTask);
}; };
} // namespace } // namespace
......
...@@ -45,13 +45,13 @@ class FunctionalTest : public ::testing::Test { ...@@ -45,13 +45,13 @@ class FunctionalTest : public ::testing::Test {
FunctionalTest() FunctionalTest()
: rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {} : rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {}
~FunctionalTest() override = default; ~FunctionalTest() override = default;
FunctionalTest(const FunctionalTest&) = delete;
FunctionalTest& operator=(const FunctionalTest&) = delete;
RandomNumberGenerator* rng() { return &rng_; } RandomNumberGenerator* rng() { return &rng_; }
private: private:
RandomNumberGenerator rng_; RandomNumberGenerator rng_;
DISALLOW_COPY_AND_ASSIGN(FunctionalTest);
}; };
using FunctionalTypes = using FunctionalTypes =
......
...@@ -29,6 +29,9 @@ namespace internal { ...@@ -29,6 +29,9 @@ namespace internal {
class CompilerDispatcherTestFlags { class CompilerDispatcherTestFlags {
public: public:
CompilerDispatcherTestFlags(const CompilerDispatcherTestFlags&) = delete;
CompilerDispatcherTestFlags& operator=(const CompilerDispatcherTestFlags&) =
delete;
static void SetFlagsForTest() { static void SetFlagsForTest() {
CHECK_NULL(save_flags_); CHECK_NULL(save_flags_);
save_flags_ = new SaveFlags(); save_flags_ = new SaveFlags();
...@@ -47,8 +50,6 @@ class CompilerDispatcherTestFlags { ...@@ -47,8 +50,6 @@ class CompilerDispatcherTestFlags {
private: private:
static SaveFlags* save_flags_; static SaveFlags* save_flags_;
DISALLOW_IMPLICIT_CONSTRUCTORS(CompilerDispatcherTestFlags);
}; };
SaveFlags* CompilerDispatcherTestFlags::save_flags_ = nullptr; SaveFlags* CompilerDispatcherTestFlags::save_flags_ = nullptr;
...@@ -57,6 +58,8 @@ class CompilerDispatcherTest : public TestWithNativeContext { ...@@ -57,6 +58,8 @@ class CompilerDispatcherTest : public TestWithNativeContext {
public: public:
CompilerDispatcherTest() = default; CompilerDispatcherTest() = default;
~CompilerDispatcherTest() override = default; ~CompilerDispatcherTest() override = default;
CompilerDispatcherTest(const CompilerDispatcherTest&) = delete;
CompilerDispatcherTest& operator=(const CompilerDispatcherTest&) = delete;
static void SetUpTestCase() { static void SetUpTestCase() {
CompilerDispatcherTestFlags::SetFlagsForTest(); CompilerDispatcherTestFlags::SetFlagsForTest();
...@@ -102,9 +105,6 @@ class CompilerDispatcherTest : public TestWithNativeContext { ...@@ -102,9 +105,6 @@ class CompilerDispatcherTest : public TestWithNativeContext {
return dispatcher->Enqueue(outer_parse_info.get(), function_name, return dispatcher->Enqueue(outer_parse_info.get(), function_name,
function_literal); function_literal);
} }
private:
DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherTest);
}; };
namespace { namespace {
...@@ -123,6 +123,8 @@ class MockPlatform : public v8::Platform { ...@@ -123,6 +123,8 @@ class MockPlatform : public v8::Platform {
EXPECT_TRUE(worker_tasks_.empty()); EXPECT_TRUE(worker_tasks_.empty());
EXPECT_TRUE(idle_task_ == nullptr); EXPECT_TRUE(idle_task_ == nullptr);
} }
MockPlatform(const MockPlatform&) = delete;
MockPlatform& operator=(const MockPlatform&) = delete;
int NumberOfWorkerThreads() override { return 1; } int NumberOfWorkerThreads() override { return 1; }
...@@ -253,6 +255,8 @@ class MockPlatform : public v8::Platform { ...@@ -253,6 +255,8 @@ class MockPlatform : public v8::Platform {
std::vector<std::unique_ptr<Task>> tasks, bool signal) std::vector<std::unique_ptr<Task>> tasks, bool signal)
: platform_(platform), tasks_(std::move(tasks)), signal_(signal) {} : platform_(platform), tasks_(std::move(tasks)), signal_(signal) {}
~TaskWrapper() override = default; ~TaskWrapper() override = default;
TaskWrapper(const TaskWrapper&) = delete;
TaskWrapper& operator=(const TaskWrapper&) = delete;
void Run() override { void Run() override {
for (auto& task : tasks_) { for (auto& task : tasks_) {
...@@ -267,8 +271,6 @@ class MockPlatform : public v8::Platform { ...@@ -267,8 +271,6 @@ class MockPlatform : public v8::Platform {
MockPlatform* platform_; MockPlatform* platform_;
std::vector<std::unique_ptr<Task>> tasks_; std::vector<std::unique_ptr<Task>> tasks_;
bool signal_; bool signal_;
DISALLOW_COPY_AND_ASSIGN(TaskWrapper);
}; };
class MockForegroundTaskRunner final : public TaskRunner { class MockForegroundTaskRunner final : public TaskRunner {
...@@ -319,8 +321,6 @@ class MockPlatform : public v8::Platform { ...@@ -319,8 +321,6 @@ class MockPlatform : public v8::Platform {
base::Semaphore sem_; base::Semaphore sem_;
v8::TracingController* tracing_controller_; v8::TracingController* tracing_controller_;
DISALLOW_COPY_AND_ASSIGN(MockPlatform);
}; };
} // namespace } // namespace
......
...@@ -37,6 +37,8 @@ class BlockingCompilationJob : public OptimizedCompilationJob { ...@@ -37,6 +37,8 @@ class BlockingCompilationJob : public OptimizedCompilationJob {
blocking_(false), blocking_(false),
semaphore_(0) {} semaphore_(0) {}
~BlockingCompilationJob() override = default; ~BlockingCompilationJob() override = default;
BlockingCompilationJob(const BlockingCompilationJob&) = delete;
BlockingCompilationJob& operator=(const BlockingCompilationJob&) = delete;
bool IsBlocking() const { return blocking_.Value(); } bool IsBlocking() const { return blocking_.Value(); }
void Signal() { semaphore_.Signal(); } void Signal() { semaphore_.Signal(); }
...@@ -60,8 +62,6 @@ class BlockingCompilationJob : public OptimizedCompilationJob { ...@@ -60,8 +62,6 @@ class BlockingCompilationJob : public OptimizedCompilationJob {
OptimizedCompilationInfo info_; OptimizedCompilationInfo info_;
base::AtomicValue<bool> blocking_; base::AtomicValue<bool> blocking_;
base::Semaphore semaphore_; base::Semaphore semaphore_;
DISALLOW_COPY_AND_ASSIGN(BlockingCompilationJob);
}; };
} // namespace } // namespace
......
...@@ -148,6 +148,8 @@ class InstructionSequenceTest : public TestWithIsolateAndZone { ...@@ -148,6 +148,8 @@ class InstructionSequenceTest : public TestWithIsolateAndZone {
} }
InstructionSequenceTest(); InstructionSequenceTest();
InstructionSequenceTest(const InstructionSequenceTest&) = delete;
InstructionSequenceTest& operator=(const InstructionSequenceTest&) = delete;
void SetNumRegs(int num_general_registers, int num_double_registers); void SetNumRegs(int num_general_registers, int num_double_registers);
int GetNumRegs(MachineRepresentation rep); int GetNumRegs(MachineRepresentation rep);
...@@ -280,8 +282,6 @@ class InstructionSequenceTest : public TestWithIsolateAndZone { ...@@ -280,8 +282,6 @@ class InstructionSequenceTest : public TestWithIsolateAndZone {
LoopBlocks loop_blocks_; LoopBlocks loop_blocks_;
InstructionBlock* current_block_; InstructionBlock* current_block_;
bool block_returns_; bool block_returns_;
DISALLOW_COPY_AND_ASSIGN(InstructionSequenceTest);
}; };
} // namespace compiler } // namespace compiler
......
...@@ -24,6 +24,8 @@ class BytecodeAnalysisTest : public TestWithIsolateAndZone { ...@@ -24,6 +24,8 @@ class BytecodeAnalysisTest : public TestWithIsolateAndZone {
public: public:
BytecodeAnalysisTest() = default; BytecodeAnalysisTest() = default;
~BytecodeAnalysisTest() override = default; ~BytecodeAnalysisTest() override = default;
BytecodeAnalysisTest(const BytecodeAnalysisTest&) = delete;
BytecodeAnalysisTest& operator=(const BytecodeAnalysisTest&) = delete;
static void SetUpTestCase() { static void SetUpTestCase() {
CHECK_NULL(save_flags_); CHECK_NULL(save_flags_);
...@@ -83,8 +85,6 @@ class BytecodeAnalysisTest : public TestWithIsolateAndZone { ...@@ -83,8 +85,6 @@ class BytecodeAnalysisTest : public TestWithIsolateAndZone {
private: private:
static SaveFlags* save_flags_; static SaveFlags* save_flags_;
DISALLOW_COPY_AND_ASSIGN(BytecodeAnalysisTest);
}; };
SaveFlags* BytecodeAnalysisTest::save_flags_ = nullptr; SaveFlags* BytecodeAnalysisTest::save_flags_ = nullptr;
......
...@@ -34,6 +34,9 @@ class WithFinalizationRegistryMixin : public TMixin { ...@@ -34,6 +34,9 @@ class WithFinalizationRegistryMixin : public TMixin {
public: public:
WithFinalizationRegistryMixin() = default; WithFinalizationRegistryMixin() = default;
~WithFinalizationRegistryMixin() override = default; ~WithFinalizationRegistryMixin() override = default;
WithFinalizationRegistryMixin(const WithFinalizationRegistryMixin&) = delete;
WithFinalizationRegistryMixin& operator=(
const WithFinalizationRegistryMixin&) = delete;
static void SetUpTestCase() { static void SetUpTestCase() {
CHECK_NULL(save_flags_); CHECK_NULL(save_flags_);
...@@ -53,8 +56,6 @@ class WithFinalizationRegistryMixin : public TMixin { ...@@ -53,8 +56,6 @@ class WithFinalizationRegistryMixin : public TMixin {
private: private:
static SaveFlags* save_flags_; static SaveFlags* save_flags_;
DISALLOW_COPY_AND_ASSIGN(WithFinalizationRegistryMixin);
}; };
template <typename TMixin> template <typename TMixin>
......
...@@ -17,15 +17,14 @@ template <typename TMixin> ...@@ -17,15 +17,14 @@ template <typename TMixin>
class WithHeapInternals : public TMixin { class WithHeapInternals : public TMixin {
public: public:
WithHeapInternals() = default; WithHeapInternals() = default;
WithHeapInternals(const WithHeapInternals&) = delete;
WithHeapInternals& operator=(const WithHeapInternals&) = delete;
void CollectGarbage(i::AllocationSpace space) { void CollectGarbage(i::AllocationSpace space) {
heap()->CollectGarbage(space, i::GarbageCollectionReason::kTesting); heap()->CollectGarbage(space, i::GarbageCollectionReason::kTesting);
} }
Heap* heap() const { return this->i_isolate()->heap(); } Heap* heap() const { return this->i_isolate()->heap(); }
private:
DISALLOW_COPY_AND_ASSIGN(WithHeapInternals);
}; };
using TestWithHeapInternals = // using TestWithHeapInternals = //
......
...@@ -13,12 +13,13 @@ namespace internal { ...@@ -13,12 +13,13 @@ namespace internal {
class ItemParallelJobTest : public TestWithIsolate { class ItemParallelJobTest : public TestWithIsolate {
public: public:
ItemParallelJobTest() : parallel_job_semaphore_(0) {} ItemParallelJobTest() : parallel_job_semaphore_(0) {}
ItemParallelJobTest(const ItemParallelJobTest&) = delete;
ItemParallelJobTest& operator=(const ItemParallelJobTest&) = delete;
base::Semaphore* parallel_job_semaphore() { return &parallel_job_semaphore_; } base::Semaphore* parallel_job_semaphore() { return &parallel_job_semaphore_; }
private: private:
base::Semaphore parallel_job_semaphore_; base::Semaphore parallel_job_semaphore_;
DISALLOW_COPY_AND_ASSIGN(ItemParallelJobTest);
}; };
namespace { namespace {
......
...@@ -227,6 +227,8 @@ class SequentialUnmapperTest : public TestWithIsolate { ...@@ -227,6 +227,8 @@ class SequentialUnmapperTest : public TestWithIsolate {
public: public:
SequentialUnmapperTest() = default; SequentialUnmapperTest() = default;
~SequentialUnmapperTest() override = default; ~SequentialUnmapperTest() override = default;
SequentialUnmapperTest(const SequentialUnmapperTest&) = delete;
SequentialUnmapperTest& operator=(const SequentialUnmapperTest&) = delete;
static void SetUpTestCase() { static void SetUpTestCase() {
CHECK_NULL(tracking_page_allocator_); CHECK_NULL(tracking_page_allocator_);
...@@ -264,8 +266,6 @@ class SequentialUnmapperTest : public TestWithIsolate { ...@@ -264,8 +266,6 @@ class SequentialUnmapperTest : public TestWithIsolate {
static TrackingPageAllocator* tracking_page_allocator_; static TrackingPageAllocator* tracking_page_allocator_;
static v8::PageAllocator* old_page_allocator_; static v8::PageAllocator* old_page_allocator_;
static bool old_flag_; static bool old_flag_;
DISALLOW_COPY_AND_ASSIGN(SequentialUnmapperTest);
}; };
TrackingPageAllocator* SequentialUnmapperTest::tracking_page_allocator_ = TrackingPageAllocator* SequentialUnmapperTest::tracking_page_allocator_ =
......
...@@ -38,6 +38,9 @@ class InterpreterAssemblerTest : public TestWithIsolateAndZone { ...@@ -38,6 +38,9 @@ class InterpreterAssemblerTest : public TestWithIsolateAndZone {
OperandScale operand_scale = OperandScale::kSingle) OperandScale operand_scale = OperandScale::kSingle)
: InterpreterAssembler(state, bytecode, operand_scale) {} : InterpreterAssembler(state, bytecode, operand_scale) {}
~InterpreterAssemblerForTest(); ~InterpreterAssemblerForTest();
InterpreterAssemblerForTest(const InterpreterAssemblerForTest&) = delete;
InterpreterAssemblerForTest& operator=(const InterpreterAssemblerForTest&) =
delete;
Matcher<compiler::Node*> IsLoad( Matcher<compiler::Node*> IsLoad(
const Matcher<compiler::LoadRepresentation>& rep_matcher, const Matcher<compiler::LoadRepresentation>& rep_matcher,
...@@ -83,9 +86,6 @@ class InterpreterAssemblerTest : public TestWithIsolateAndZone { ...@@ -83,9 +86,6 @@ class InterpreterAssemblerTest : public TestWithIsolateAndZone {
Matcher<compiler::Node*> IsLoadRegisterOperand(int offset, Matcher<compiler::Node*> IsLoadRegisterOperand(int offset,
OperandSize operand_size); OperandSize operand_size);
private:
DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest);
}; };
}; };
......
...@@ -26,6 +26,10 @@ using ::testing::Invoke; ...@@ -26,6 +26,10 @@ using ::testing::Invoke;
using ::testing::Return; using ::testing::Return;
class ValueSerializerTest : public TestWithIsolate { class ValueSerializerTest : public TestWithIsolate {
public:
ValueSerializerTest(const ValueSerializerTest&) = delete;
ValueSerializerTest& operator=(const ValueSerializerTest&) = delete;
protected: protected:
ValueSerializerTest() ValueSerializerTest()
: serialization_context_(Context::New(isolate())), : serialization_context_(Context::New(isolate())),
...@@ -266,8 +270,6 @@ class ValueSerializerTest : public TestWithIsolate { ...@@ -266,8 +270,6 @@ class ValueSerializerTest : public TestWithIsolate {
Local<Context> deserialization_context_; Local<Context> deserialization_context_;
Local<FunctionTemplate> host_object_constructor_template_; Local<FunctionTemplate> host_object_constructor_template_;
i::Isolate* isolate_; i::Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(ValueSerializerTest);
}; };
TEST_F(ValueSerializerTest, DecodeInvalid) { TEST_F(ValueSerializerTest, DecodeInvalid) {
......
...@@ -14,9 +14,8 @@ namespace internal { ...@@ -14,9 +14,8 @@ namespace internal {
class PreParserTest : public TestWithNativeContext { class PreParserTest : public TestWithNativeContext {
public: public:
PreParserTest() = default; PreParserTest() = default;
PreParserTest(const PreParserTest&) = delete;
private: PreParserTest& operator=(const PreParserTest&) = delete;
DISALLOW_COPY_AND_ASSIGN(PreParserTest);
}; };
TEST_F(PreParserTest, LazyFunctionLength) { TEST_F(PreParserTest, LazyFunctionLength) {
......
...@@ -29,6 +29,9 @@ class BackgroundCompileTaskTest : public TestWithNativeContext { ...@@ -29,6 +29,9 @@ class BackgroundCompileTaskTest : public TestWithNativeContext {
public: public:
BackgroundCompileTaskTest() : allocator_(isolate()->allocator()) {} BackgroundCompileTaskTest() : allocator_(isolate()->allocator()) {}
~BackgroundCompileTaskTest() override = default; ~BackgroundCompileTaskTest() override = default;
BackgroundCompileTaskTest(const BackgroundCompileTaskTest&) = delete;
BackgroundCompileTaskTest& operator=(const BackgroundCompileTaskTest&) =
delete;
AccountingAllocator* allocator() { return allocator_; } AccountingAllocator* allocator() { return allocator_; }
...@@ -87,8 +90,6 @@ class BackgroundCompileTaskTest : public TestWithNativeContext { ...@@ -87,8 +90,6 @@ class BackgroundCompileTaskTest : public TestWithNativeContext {
private: private:
AccountingAllocator* allocator_; AccountingAllocator* allocator_;
static SaveFlags* save_flags_; static SaveFlags* save_flags_;
DISALLOW_COPY_AND_ASSIGN(BackgroundCompileTaskTest);
}; };
SaveFlags* BackgroundCompileTaskTest::save_flags_ = nullptr; SaveFlags* BackgroundCompileTaskTest::save_flags_ = nullptr;
...@@ -173,6 +174,8 @@ class CompileTask : public Task { ...@@ -173,6 +174,8 @@ class CompileTask : public Task {
CompileTask(BackgroundCompileTask* task, base::Semaphore* semaphore) CompileTask(BackgroundCompileTask* task, base::Semaphore* semaphore)
: task_(task), semaphore_(semaphore) {} : task_(task), semaphore_(semaphore) {}
~CompileTask() override = default; ~CompileTask() override = default;
CompileTask(const CompileTask&) = delete;
CompileTask& operator=(const CompileTask&) = delete;
void Run() override { void Run() override {
task_->Run(); task_->Run();
...@@ -182,7 +185,6 @@ class CompileTask : public Task { ...@@ -182,7 +185,6 @@ class CompileTask : public Task {
private: private:
BackgroundCompileTask* task_; BackgroundCompileTask* task_;
base::Semaphore* semaphore_; base::Semaphore* semaphore_;
DISALLOW_COPY_AND_ASSIGN(CompileTask);
}; };
TEST_F(BackgroundCompileTaskTest, CompileOnBackgroundThread) { TEST_F(BackgroundCompileTaskTest, CompileOnBackgroundThread) {
......
...@@ -28,6 +28,8 @@ class ScriptResource : public v8::String::ExternalOneByteStringResource { ...@@ -28,6 +28,8 @@ class ScriptResource : public v8::String::ExternalOneByteStringResource {
ScriptResource(const char* data, size_t length) ScriptResource(const char* data, size_t length)
: data_(data), length_(length) {} : data_(data), length_(length) {}
~ScriptResource() override = default; ~ScriptResource() override = default;
ScriptResource(const ScriptResource&) = delete;
ScriptResource& operator=(const ScriptResource&) = delete;
const char* data() const override { return data_; } const char* data() const override { return data_; }
size_t length() const override { return length_; } size_t length() const override { return length_; }
...@@ -35,8 +37,6 @@ class ScriptResource : public v8::String::ExternalOneByteStringResource { ...@@ -35,8 +37,6 @@ class ScriptResource : public v8::String::ExternalOneByteStringResource {
private: private:
const char* data_; const char* data_;
size_t length_; size_t length_;
DISALLOW_COPY_AND_ASSIGN(ScriptResource);
}; };
Handle<String> CreateSource( Handle<String> CreateSource(
......
...@@ -32,6 +32,8 @@ class IsolateWrapper final { ...@@ -32,6 +32,8 @@ class IsolateWrapper final {
public: public:
explicit IsolateWrapper(CountersMode counters_mode); explicit IsolateWrapper(CountersMode counters_mode);
~IsolateWrapper(); ~IsolateWrapper();
IsolateWrapper(const IsolateWrapper&) = delete;
IsolateWrapper& operator=(const IsolateWrapper&) = delete;
v8::Isolate* isolate() const { return isolate_; } v8::Isolate* isolate() const { return isolate_; }
...@@ -39,8 +41,6 @@ class IsolateWrapper final { ...@@ -39,8 +41,6 @@ class IsolateWrapper final {
std::unique_ptr<v8::ArrayBuffer::Allocator> array_buffer_allocator_; std::unique_ptr<v8::ArrayBuffer::Allocator> array_buffer_allocator_;
std::unique_ptr<CounterMap> counter_map_; std::unique_ptr<CounterMap> counter_map_;
v8::Isolate* isolate_; v8::Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(IsolateWrapper);
}; };
// //
...@@ -62,6 +62,8 @@ class WithIsolateScopeMixin : public TMixin { ...@@ -62,6 +62,8 @@ class WithIsolateScopeMixin : public TMixin {
public: public:
WithIsolateScopeMixin() WithIsolateScopeMixin()
: isolate_scope_(this->v8_isolate()), handle_scope_(this->v8_isolate()) {} : isolate_scope_(this->v8_isolate()), handle_scope_(this->v8_isolate()) {}
WithIsolateScopeMixin(const WithIsolateScopeMixin&) = delete;
WithIsolateScopeMixin& operator=(const WithIsolateScopeMixin&) = delete;
v8::Isolate* isolate() const { return this->v8_isolate(); } v8::Isolate* isolate() const { return this->v8_isolate(); }
...@@ -72,8 +74,6 @@ class WithIsolateScopeMixin : public TMixin { ...@@ -72,8 +74,6 @@ class WithIsolateScopeMixin : public TMixin {
private: private:
v8::Isolate::Scope isolate_scope_; v8::Isolate::Scope isolate_scope_;
v8::HandleScope handle_scope_; v8::HandleScope handle_scope_;
DISALLOW_COPY_AND_ASSIGN(WithIsolateScopeMixin);
}; };
template <typename TMixin> template <typename TMixin>
...@@ -81,6 +81,8 @@ class WithContextMixin : public TMixin { ...@@ -81,6 +81,8 @@ class WithContextMixin : public TMixin {
public: public:
WithContextMixin() WithContextMixin()
: context_(Context::New(this->v8_isolate())), context_scope_(context_) {} : context_(Context::New(this->v8_isolate())), context_scope_(context_) {}
WithContextMixin(const WithContextMixin&) = delete;
WithContextMixin& operator=(const WithContextMixin&) = delete;
const Local<Context>& context() const { return v8_context(); } const Local<Context>& context() const { return v8_context(); }
const Local<Context>& v8_context() const { return context_; } const Local<Context>& v8_context() const { return context_; }
...@@ -116,8 +118,6 @@ class WithContextMixin : public TMixin { ...@@ -116,8 +118,6 @@ class WithContextMixin : public TMixin {
v8::Local<v8::Context> context_; v8::Local<v8::Context> context_;
v8::Context::Scope context_scope_; v8::Context::Scope context_scope_;
DISALLOW_COPY_AND_ASSIGN(WithContextMixin);
}; };
// Use v8::internal::TestWithIsolate if you are testing internals, // Use v8::internal::TestWithIsolate if you are testing internals,
...@@ -144,6 +144,8 @@ template <typename TMixin> ...@@ -144,6 +144,8 @@ template <typename TMixin>
class WithInternalIsolateMixin : public TMixin { class WithInternalIsolateMixin : public TMixin {
public: public:
WithInternalIsolateMixin() = default; WithInternalIsolateMixin() = default;
WithInternalIsolateMixin(const WithInternalIsolateMixin&) = delete;
WithInternalIsolateMixin& operator=(const WithInternalIsolateMixin&) = delete;
Factory* factory() const { return isolate()->factory(); } Factory* factory() const { return isolate()->factory(); }
Isolate* isolate() const { return TMixin::i_isolate(); } Isolate* isolate() const { return TMixin::i_isolate(); }
...@@ -174,9 +176,6 @@ class WithInternalIsolateMixin : public TMixin { ...@@ -174,9 +176,6 @@ class WithInternalIsolateMixin : public TMixin {
base::RandomNumberGenerator* random_number_generator() const { base::RandomNumberGenerator* random_number_generator() const {
return isolate()->random_number_generator(); return isolate()->random_number_generator();
} }
private:
DISALLOW_COPY_AND_ASSIGN(WithInternalIsolateMixin);
}; };
template <typename TMixin> template <typename TMixin>
...@@ -184,14 +183,14 @@ class WithZoneMixin : public TMixin { ...@@ -184,14 +183,14 @@ class WithZoneMixin : public TMixin {
public: public:
explicit WithZoneMixin(bool support_zone_compression = false) explicit WithZoneMixin(bool support_zone_compression = false)
: zone_(&allocator_, ZONE_NAME, support_zone_compression) {} : zone_(&allocator_, ZONE_NAME, support_zone_compression) {}
WithZoneMixin(const WithZoneMixin&) = delete;
WithZoneMixin& operator=(const WithZoneMixin&) = delete;
Zone* zone() { return &zone_; } Zone* zone() { return &zone_; }
private: private:
v8::internal::AccountingAllocator allocator_; v8::internal::AccountingAllocator allocator_;
Zone zone_; Zone zone_;
DISALLOW_COPY_AND_ASSIGN(WithZoneMixin);
}; };
using TestWithIsolate = // using TestWithIsolate = //
...@@ -235,13 +234,13 @@ class SaveFlags { ...@@ -235,13 +234,13 @@ class SaveFlags {
public: public:
SaveFlags(); SaveFlags();
~SaveFlags(); ~SaveFlags();
SaveFlags(const SaveFlags&) = delete;
SaveFlags& operator=(const SaveFlags&) = delete;
private: private:
#define FLAG_MODE_APPLY(ftype, ctype, nam, def, cmt) ctype SAVED_##nam; #define FLAG_MODE_APPLY(ftype, ctype, nam, def, cmt) ctype SAVED_##nam;
#include "src/flags/flag-definitions.h" // NOLINT #include "src/flags/flag-definitions.h" // NOLINT
#undef FLAG_MODE_APPLY #undef FLAG_MODE_APPLY
DISALLOW_COPY_AND_ASSIGN(SaveFlags);
}; };
// For GTest. // For GTest.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment