[cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{cctest,fuzzer,inspector}

Bug: v8:11074
Change-Id: I4e53abf1c4d5dcf8342eff98a699afeac7719d36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2522731
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71065}
This commit is contained in:
Zhi An Ng 2020-11-06 02:39:19 +00:00 committed by Commit Bot
parent 2565c9dd9a
commit e42e855462
15 changed files with 41 additions and 33 deletions

View File

@ -685,6 +685,9 @@ class ManualGCScope {
// of construction.
class TestPlatform : public v8::Platform {
public:
TestPlatform(const TestPlatform&) = delete;
TestPlatform& operator=(const TestPlatform&) = delete;
// v8::Platform implementation.
v8::PageAllocator* GetPageAllocator() override {
return old_platform_->GetPageAllocator();
@ -746,8 +749,6 @@ class TestPlatform : public v8::Platform {
private:
v8::Platform* old_platform_;
DISALLOW_COPY_AND_ASSIGN(TestPlatform);
};
#if defined(USE_SIMULATOR)

View File

@ -80,6 +80,8 @@ class BytecodeGraphTester {
i::FLAG_allow_natives_syntax = true;
}
virtual ~BytecodeGraphTester() = default;
BytecodeGraphTester(const BytecodeGraphTester&) = delete;
BytecodeGraphTester& operator=(const BytecodeGraphTester&) = delete;
template <class... A>
BytecodeGraphCallable<A...> GetCallable(
@ -137,8 +139,6 @@ class BytecodeGraphTester {
return function;
}
DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester);
};
#define SPACE()

View File

@ -75,11 +75,13 @@ class TestMemoryAllocatorScope {
isolate_->GetCodePages()->swap(code_pages_);
}
TestMemoryAllocatorScope(const TestMemoryAllocatorScope&) = delete;
TestMemoryAllocatorScope& operator=(const TestMemoryAllocatorScope&) = delete;
private:
Isolate* isolate_;
std::unique_ptr<MemoryAllocator> old_allocator_;
std::vector<MemoryRange> code_pages_;
DISALLOW_COPY_AND_ASSIGN(TestMemoryAllocatorScope);
};
// Temporarily sets a given code page allocator in an isolate.
@ -98,12 +100,13 @@ class TestCodePageAllocatorScope {
isolate_->heap()->memory_allocator()->code_page_allocator_ =
old_code_page_allocator_;
}
TestCodePageAllocatorScope(const TestCodePageAllocatorScope&) = delete;
TestCodePageAllocatorScope& operator=(const TestCodePageAllocatorScope&) =
delete;
private:
Isolate* isolate_;
v8::PageAllocator* old_code_page_allocator_;
DISALLOW_COPY_AND_ASSIGN(TestCodePageAllocatorScope);
};
static void VerifyMemoryChunk(Isolate* isolate, Heap* heap,

View File

@ -103,6 +103,8 @@ class V8InitializationScope final {
public:
explicit V8InitializationScope(const char* exec_path);
~V8InitializationScope();
V8InitializationScope(const V8InitializationScope&) = delete;
V8InitializationScope& operator=(const V8InitializationScope&) = delete;
v8::Platform* platform() const { return platform_.get(); }
v8::Isolate* isolate() const { return isolate_; }
@ -111,8 +113,6 @@ class V8InitializationScope final {
std::unique_ptr<v8::Platform> platform_;
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator_;
v8::Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(V8InitializationScope);
};
bool ParseBoolean(const char* string) {

View File

@ -86,6 +86,8 @@ class InterpreterTester {
const char* filter = kFunctionName);
virtual ~InterpreterTester();
InterpreterTester(const InterpreterTester&) = delete;
InterpreterTester& operator=(const InterpreterTester&) = delete;
template <class... A>
InterpreterCallableUndefinedReceiver<A...> GetCallable() {
@ -166,8 +168,6 @@ class InterpreterTester {
}
return function;
}
DISALLOW_COPY_AND_ASSIGN(InterpreterTester);
};
} // namespace interpreter

View File

@ -60,6 +60,9 @@ TEST(TestTraceObject) {
class ConvertableToTraceFormatMock : public v8::ConvertableToTraceFormat {
public:
ConvertableToTraceFormatMock(const ConvertableToTraceFormatMock&) = delete;
ConvertableToTraceFormatMock& operator=(const ConvertableToTraceFormatMock&) =
delete;
explicit ConvertableToTraceFormatMock(int value) : value_(value) {}
void AppendAsTraceFormat(std::string* out) const override {
*out += "[" + std::to_string(value_) + "," + std::to_string(value_) + "]";
@ -67,8 +70,6 @@ class ConvertableToTraceFormatMock : public v8::ConvertableToTraceFormat {
private:
int value_;
DISALLOW_COPY_AND_ASSIGN(ConvertableToTraceFormatMock);
};
class MockTraceWriter : public TraceWriter {

View File

@ -363,6 +363,8 @@ class JoinableThread {
}
virtual ~JoinableThread() = default;
JoinableThread(const JoinableThread&) = delete;
JoinableThread& operator=(const JoinableThread&) = delete;
void Start() { CHECK(thread_.Start()); }
@ -394,8 +396,6 @@ class JoinableThread {
ThreadWithSemaphore thread_;
friend class ThreadWithSemaphore;
DISALLOW_COPY_AND_ASSIGN(JoinableThread);
};

View File

@ -83,6 +83,9 @@ class ScopedLoggerInitializer {
if (log_file != nullptr) fclose(log_file);
}
ScopedLoggerInitializer(const ScopedLoggerInitializer&) = delete;
ScopedLoggerInitializer& operator=(const ScopedLoggerInitializer&) = delete;
v8::Local<v8::Context>& env() { return env_; }
v8::Isolate* isolate() { return isolate_; }
@ -212,8 +215,6 @@ class ScopedLoggerInitializer {
std::string raw_log_;
std::vector<std::string> log_;
DISALLOW_COPY_AND_ASSIGN(ScopedLoggerInitializer);
};
class TestCodeEventHandler : public v8::CodeEventHandler {

View File

@ -222,6 +222,8 @@ static void InitializeBuildingBlocks(Handle<String>* building_blocks,
class ConsStringStats {
public:
ConsStringStats() { Reset(); }
ConsStringStats(const ConsStringStats&) = delete;
ConsStringStats& operator=(const ConsStringStats&) = delete;
void Reset();
void VerifyEqual(const ConsStringStats& that) const;
int leaves_;
@ -231,7 +233,6 @@ class ConsStringStats {
int right_traversals_;
private:
DISALLOW_COPY_AND_ASSIGN(ConsStringStats);
};
void ConsStringStats::Reset() {
@ -254,6 +255,8 @@ class ConsStringGenerationData {
public:
static const int kNumberOfBuildingBlocks = 256;
explicit ConsStringGenerationData(bool long_blocks);
ConsStringGenerationData(const ConsStringGenerationData&) = delete;
ConsStringGenerationData& operator=(const ConsStringGenerationData&) = delete;
void Reset();
inline Handle<String> block(int offset);
inline Handle<String> block(uint32_t offset);
@ -270,9 +273,6 @@ class ConsStringGenerationData {
// Stats.
ConsStringStats stats_;
int early_terminations_;
private:
DISALLOW_COPY_AND_ASSIGN(ConsStringGenerationData);
};
ConsStringGenerationData::ConsStringGenerationData(bool long_blocks) {

View File

@ -34,6 +34,8 @@ struct MockTraceObject {
class MockTracingController : public v8::TracingController {
public:
MockTracingController() = default;
MockTracingController(const MockTracingController&) = delete;
MockTracingController& operator=(const MockTracingController&) = delete;
uint64_t AddTraceEvent(
char phase, const uint8_t* category_enabled_flag, const char* name,
@ -80,8 +82,6 @@ class MockTracingController : public v8::TracingController {
private:
std::vector<std::unique_ptr<MockTraceObject>> trace_objects_;
DISALLOW_COPY_AND_ASSIGN(MockTracingController);
};
class MockTracingPlatform : public TestPlatform {

View File

@ -39,6 +39,8 @@ class DataRange {
public:
explicit DataRange(Vector<const uint8_t> data) : data_(data) {}
DataRange(const DataRange&) = delete;
DataRange& operator=(const DataRange&) = delete;
// Don't accidentally pass DataRange by value. This will reuse bytes and might
// lead to OOM because the end might not be reached.
@ -83,8 +85,6 @@ class DataRange {
data_ += num_bytes;
return result;
}
DISALLOW_COPY_AND_ASSIGN(DataRange);
};
ValueType GetValueType(DataRange* data) {

View File

@ -23,6 +23,8 @@ class FrontendChannelImpl : public v8_inspector::V8Inspector::Channel {
context_group_id_(context_group_id),
function_(isolate, function) {}
~FrontendChannelImpl() override = default;
FrontendChannelImpl(const FrontendChannelImpl&) = delete;
FrontendChannelImpl& operator=(const FrontendChannelImpl&) = delete;
void set_session_id(int session_id) { session_id_ = session_id; }
@ -69,7 +71,6 @@ class FrontendChannelImpl : public v8_inspector::V8Inspector::Channel {
int context_group_id_;
v8::Global<v8::Function> function_;
int session_id_;
DISALLOW_COPY_AND_ASSIGN(FrontendChannelImpl);
};
} // namespace internal

View File

@ -32,6 +32,8 @@ class IsolateData : public v8_inspector::V8InspectorClient {
};
using SetupGlobalTasks = std::vector<std::unique_ptr<SetupGlobalTask>>;
IsolateData(const IsolateData&) = delete;
IsolateData& operator=(const IsolateData&) = delete;
IsolateData(TaskRunner* task_runner, SetupGlobalTasks setup_global_tasks,
v8::StartupData* startup_data, WithInspector with_inspector);
static IsolateData* FromContext(v8::Local<v8::Context> context);
@ -148,8 +150,6 @@ class IsolateData : public v8_inspector::V8InspectorClient {
v8::Global<v8::Private> not_inspectable_private_;
v8::Global<v8::String> resource_name_prefix_;
v8::Global<v8::String> additional_console_api_;
DISALLOW_COPY_AND_ASSIGN(IsolateData);
};
} // namespace internal

View File

@ -39,6 +39,8 @@ class TaskRunner : public v8::base::Thread {
v8::base::Semaphore* ready_semaphore,
v8::StartupData* startup_data, WithInspector with_inspector);
~TaskRunner() override;
TaskRunner(const TaskRunner&) = delete;
TaskRunner& operator=(const TaskRunner&) = delete;
IsolateData* data() const { return data_.get(); }
// Thread implementation.
@ -73,8 +75,6 @@ class TaskRunner : public v8::base::Thread {
int nested_loop_count_;
std::atomic<int> is_terminated_;
DISALLOW_COPY_AND_ASSIGN(TaskRunner);
};
} // namespace internal

View File

@ -65,6 +65,8 @@ inline void RunAsyncTask(TaskRunner* task_runner,
explicit AsyncTask(std::unique_ptr<TaskRunner::Task> inner)
: inner_(std::move(inner)) {}
~AsyncTask() override = default;
AsyncTask(const AsyncTask&) = delete;
AsyncTask& operator=(const AsyncTask&) = delete;
bool is_priority_task() override { return inner_->is_priority_task(); }
void Run(IsolateData* data) override {
data->AsyncTaskStarted(inner_.get());
@ -74,7 +76,6 @@ inline void RunAsyncTask(TaskRunner* task_runner,
private:
std::unique_ptr<TaskRunner::Task> inner_;
DISALLOW_COPY_AND_ASSIGN(AsyncTask);
};
task_runner->data()->AsyncTaskScheduled(task_name, task.get(), false);
@ -100,6 +101,8 @@ class ExecuteStringTask : public TaskRunner::Task {
: expression_utf8_(expression), context_group_id_(context_group_id) {}
~ExecuteStringTask() override = default;
ExecuteStringTask(const ExecuteStringTask&) = delete;
ExecuteStringTask& operator=(const ExecuteStringTask&) = delete;
bool is_priority_task() override { return false; }
void Run(IsolateData* data) override;
@ -111,8 +114,6 @@ class ExecuteStringTask : public TaskRunner::Task {
int32_t column_offset_ = 0;
bool is_module_ = false;
int context_group_id_;
DISALLOW_COPY_AND_ASSIGN(ExecuteStringTask);
};
class SetTimeoutTask : public TaskRunner::Task {