Commit 5fe48817 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][libplatform] Remove uses of DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: I0b819aba03d720780142bcc937e2f148d39f9be9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567537
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71520}
parent 393782ef
......@@ -106,6 +106,9 @@ class V8_PLATFORM_EXPORT DefaultJobHandle : public JobHandle {
explicit DefaultJobHandle(std::shared_ptr<DefaultJobState> state);
~DefaultJobHandle() override;
DefaultJobHandle(const DefaultJobHandle&) = delete;
DefaultJobHandle& operator=(const DefaultJobHandle&) = delete;
void NotifyConcurrencyIncrease() override {
state_->NotifyConcurrencyIncrease();
}
......@@ -124,8 +127,6 @@ class V8_PLATFORM_EXPORT DefaultJobHandle : public JobHandle {
private:
std::shared_ptr<DefaultJobState> state_;
DISALLOW_COPY_AND_ASSIGN(DefaultJobHandle);
};
class DefaultJobWorker : public Task {
......@@ -134,6 +135,9 @@ class DefaultJobWorker : public Task {
: state_(std::move(state)), job_task_(job_task) {}
~DefaultJobWorker() override = default;
DefaultJobWorker(const DefaultJobWorker&) = delete;
DefaultJobWorker& operator=(const DefaultJobWorker&) = delete;
void Run() override {
auto shared_state = state_.lock();
if (!shared_state) return;
......@@ -151,8 +155,6 @@ class DefaultJobWorker : public Task {
std::weak_ptr<DefaultJobState> state_;
JobTask* job_task_;
DISALLOW_COPY_AND_ASSIGN(DefaultJobWorker);
};
} // namespace platform
......
......@@ -35,6 +35,9 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
~DefaultPlatform() override;
DefaultPlatform(const DefaultPlatform&) = delete;
DefaultPlatform& operator=(const DefaultPlatform&) = delete;
void EnsureBackgroundTaskRunnerInitialized();
bool PumpMessageLoop(
......@@ -80,7 +83,6 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
std::unique_ptr<PageAllocator> page_allocator_;
TimeFunction time_function_for_testing_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(DefaultPlatform);
};
} // namespace platform
......
......@@ -47,13 +47,14 @@ class V8_PLATFORM_EXPORT DefaultWorkerThreadsTaskRunner
explicit WorkerThread(DefaultWorkerThreadsTaskRunner* runner);
~WorkerThread() override;
WorkerThread(const WorkerThread&) = delete;
WorkerThread& operator=(const WorkerThread&) = delete;
// This thread attempts to get tasks in a loop from |runner_| and run them.
void Run() override;
private:
DefaultWorkerThreadsTaskRunner* runner_;
DISALLOW_COPY_AND_ASSIGN(WorkerThread);
};
// Called by the WorkerThread. Gets the next take (delayed or immediate) to be
......
......@@ -30,6 +30,9 @@ class V8_PLATFORM_EXPORT DelayedTaskQueue {
explicit DelayedTaskQueue(TimeFunction time_function);
~DelayedTaskQueue();
DelayedTaskQueue(const DelayedTaskQueue&) = delete;
DelayedTaskQueue& operator=(const DelayedTaskQueue&) = delete;
double MonotonicallyIncreasingTime();
// Appends an immediate task to the queue. The queue takes ownership of
......@@ -59,8 +62,6 @@ class V8_PLATFORM_EXPORT DelayedTaskQueue {
std::multimap<double, std::unique_ptr<Task>> delayed_task_queue_;
bool terminated_ = false;
TimeFunction time_function_;
DISALLOW_COPY_AND_ASSIGN(DelayedTaskQueue);
};
} // namespace platform
......
......@@ -25,6 +25,9 @@ class V8_PLATFORM_EXPORT TaskQueue {
TaskQueue();
~TaskQueue();
TaskQueue(const TaskQueue&) = delete;
TaskQueue& operator=(const TaskQueue&) = delete;
// Appends a task to the queue. The queue takes ownership of |task|.
void Append(std::unique_ptr<Task> task);
......@@ -44,8 +47,6 @@ class V8_PLATFORM_EXPORT TaskQueue {
base::Mutex lock_;
std::queue<std::unique_ptr<Task>> task_queue_;
bool terminated_;
DISALLOW_COPY_AND_ASSIGN(TaskQueue);
};
} // namespace platform
......
......@@ -23,13 +23,14 @@ class V8_PLATFORM_EXPORT WorkerThread : public NON_EXPORTED_BASE(base::Thread) {
explicit WorkerThread(TaskQueue* queue);
~WorkerThread() override;
WorkerThread(const WorkerThread&) = delete;
WorkerThread& operator=(const WorkerThread&) = delete;
// Thread implementation.
void Run() override;
private:
TaskQueue* queue_;
DISALLOW_COPY_AND_ASSIGN(WorkerThread);
};
} // namespace platform
......
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