Commit 0e1fa534 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Remove DISALLOW_COPY_AND_ASSIGN from base/task/sequence_manager

Also fixes a few cpp lint warnings. No functional changes.

Bug: 1010217
Change-Id: If2e666a7b57f92a0f8dce2c1b81957d89adc9122
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416848Reviewed-by: default avatarEtienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807989}
parent 2d6a0abd
...@@ -28,7 +28,8 @@ class BASE_EXPORT AtomicFlagSet { ...@@ -28,7 +28,8 @@ class BASE_EXPORT AtomicFlagSet {
public: public:
explicit AtomicFlagSet(scoped_refptr<AssociatedThreadId> associated_thread); explicit AtomicFlagSet(scoped_refptr<AssociatedThreadId> associated_thread);
AtomicFlagSet(const AtomicFlagSet&) = delete;
AtomicFlagSet& operator=(const AtomicFlagSet&) = delete;
// AtomicFlags need to be released (or deleted) before this can be deleted. // AtomicFlags need to be released (or deleted) before this can be deleted.
~AtomicFlagSet(); ~AtomicFlagSet();
...@@ -89,6 +90,8 @@ class BASE_EXPORT AtomicFlagSet { ...@@ -89,6 +90,8 @@ class BASE_EXPORT AtomicFlagSet {
// AtomicFlag's with one bit per flag. // AtomicFlag's with one bit per flag.
struct BASE_EXPORT Group { struct BASE_EXPORT Group {
Group(); Group();
Group(const Group&) = delete;
Group& operator=(const Group&) = delete;
~Group(); ~Group();
static constexpr int kNumFlags = sizeof(size_t) * 8; static constexpr int kNumFlags = sizeof(size_t) * 8;
...@@ -112,9 +115,6 @@ class BASE_EXPORT AtomicFlagSet { ...@@ -112,9 +115,6 @@ class BASE_EXPORT AtomicFlagSet {
// Computes the index of the |flag_callbacks| based on the number of leading // Computes the index of the |flag_callbacks| based on the number of leading
// zero bits in |flag|. // zero bits in |flag|.
static int IndexOfFirstFlagSet(size_t flag); static int IndexOfFirstFlagSet(size_t flag);
private:
DISALLOW_COPY_AND_ASSIGN(Group);
}; };
private: private:
...@@ -131,8 +131,6 @@ class BASE_EXPORT AtomicFlagSet { ...@@ -131,8 +131,6 @@ class BASE_EXPORT AtomicFlagSet {
scoped_refptr<AssociatedThreadId> associated_thread_; scoped_refptr<AssociatedThreadId> associated_thread_;
std::unique_ptr<Group> alloc_list_head_; std::unique_ptr<Group> alloc_list_head_;
Group* partially_free_list_head_ = nullptr; Group* partially_free_list_head_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(AtomicFlagSet);
}; };
} // namespace internal } // namespace internal
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <atomic> #include <atomic>
#include "base/base_export.h" #include "base/base_export.h"
#include "base/macros.h"
#include "base/task/sequence_manager/enqueue_order.h" #include "base/task/sequence_manager/enqueue_order.h"
namespace base { namespace base {
...@@ -23,6 +22,8 @@ namespace internal { ...@@ -23,6 +22,8 @@ namespace internal {
class BASE_EXPORT EnqueueOrderGenerator { class BASE_EXPORT EnqueueOrderGenerator {
public: public:
EnqueueOrderGenerator(); EnqueueOrderGenerator();
EnqueueOrderGenerator(const EnqueueOrderGenerator&) = delete;
EnqueueOrderGenerator& operator=(const EnqueueOrderGenerator&) = delete;
~EnqueueOrderGenerator(); ~EnqueueOrderGenerator();
// Can be called from any thread. // Can be called from any thread.
...@@ -33,7 +34,6 @@ class BASE_EXPORT EnqueueOrderGenerator { ...@@ -33,7 +34,6 @@ class BASE_EXPORT EnqueueOrderGenerator {
private: private:
std::atomic<uint64_t> counter_; std::atomic<uint64_t> counter_;
DISALLOW_COPY_AND_ASSIGN(EnqueueOrderGenerator);
}; };
} // namespace internal } // namespace internal
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <memory> #include <memory>
#include <utility>
#include <vector> #include <vector>
#include "base/check_op.h" #include "base/check_op.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/time/time.h" #include "base/time/time.h"
namespace base { namespace base {
...@@ -51,8 +51,9 @@ class LazilyDeallocatedDeque { ...@@ -51,8 +51,9 @@ class LazilyDeallocatedDeque {
kMinimumShrinkIntervalInSeconds = 5 kMinimumShrinkIntervalInSeconds = 5
}; };
LazilyDeallocatedDeque() {} LazilyDeallocatedDeque() = default;
LazilyDeallocatedDeque(const LazilyDeallocatedDeque&) = delete;
LazilyDeallocatedDeque& operator=(const LazilyDeallocatedDeque&) = delete;
~LazilyDeallocatedDeque() { clear(); } ~LazilyDeallocatedDeque() { clear(); }
bool empty() const { return size_ == 0; } bool empty() const { return size_ == 0; }
...@@ -237,7 +238,8 @@ class LazilyDeallocatedDeque { ...@@ -237,7 +238,8 @@ class LazilyDeallocatedDeque {
next_(nullptr) { next_(nullptr) {
DCHECK_GE(capacity_, kMinimumRingSize); DCHECK_GE(capacity_, kMinimumRingSize);
} }
Ring(const Ring&) = delete;
Ring& operator=(const Ring&) = delete;
~Ring() { ~Ring() {
while (!empty()) { while (!empty()) {
pop_front(); pop_front();
...@@ -313,8 +315,6 @@ class LazilyDeallocatedDeque { ...@@ -313,8 +315,6 @@ class LazilyDeallocatedDeque {
size_t back_index_; size_t back_index_;
T* data_; T* data_;
std::unique_ptr<Ring> next_; std::unique_ptr<Ring> next_;
DISALLOW_COPY_AND_ASSIGN(Ring);
}; };
public: public:
...@@ -370,8 +370,6 @@ class LazilyDeallocatedDeque { ...@@ -370,8 +370,6 @@ class LazilyDeallocatedDeque {
size_t size_ = 0; size_t size_ = 0;
size_t max_size_ = 0; size_t max_size_ = 0;
TimeTicks next_resize_time_; TimeTicks next_resize_time_;
DISALLOW_COPY_AND_ASSIGN(LazilyDeallocatedDeque);
}; };
} // namespace internal } // namespace internal
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define BASE_TASK_SEQUENCE_MANAGER_LAZY_NOW_H_ #define BASE_TASK_SEQUENCE_MANAGER_LAZY_NOW_H_
#include "base/base_export.h" #include "base/base_export.h"
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -23,6 +22,8 @@ class BASE_EXPORT LazyNow { ...@@ -23,6 +22,8 @@ class BASE_EXPORT LazyNow {
public: public:
explicit LazyNow(TimeTicks now); explicit LazyNow(TimeTicks now);
explicit LazyNow(const TickClock* tick_clock); explicit LazyNow(const TickClock* tick_clock);
LazyNow(const LazyNow&) = delete;
LazyNow& operator=(const LazyNow&) = delete;
LazyNow(LazyNow&& move_from) noexcept; LazyNow(LazyNow&& move_from) noexcept;
...@@ -34,8 +35,6 @@ class BASE_EXPORT LazyNow { ...@@ -34,8 +35,6 @@ class BASE_EXPORT LazyNow {
private: private:
const TickClock* tick_clock_; // Not owned. const TickClock* tick_clock_; // Not owned.
Optional<TimeTicks> now_; Optional<TimeTicks> now_;
DISALLOW_COPY_AND_ASSIGN(LazyNow);
}; };
} // namespace sequence_manager } // namespace sequence_manager
......
...@@ -10,10 +10,6 @@ namespace base { ...@@ -10,10 +10,6 @@ namespace base {
namespace sequence_manager { namespace sequence_manager {
namespace internal { namespace internal {
RealTimeDomain::RealTimeDomain() {}
RealTimeDomain::~RealTimeDomain() = default;
void RealTimeDomain::OnRegisterWithSequenceManager( void RealTimeDomain::OnRegisterWithSequenceManager(
SequenceManagerImpl* sequence_manager) { SequenceManagerImpl* sequence_manager) {
TimeDomain::OnRegisterWithSequenceManager(sequence_manager); TimeDomain::OnRegisterWithSequenceManager(sequence_manager);
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define BASE_TASK_SEQUENCE_MANAGER_REAL_TIME_DOMAIN_H_ #define BASE_TASK_SEQUENCE_MANAGER_REAL_TIME_DOMAIN_H_
#include "base/base_export.h" #include "base/base_export.h"
#include "base/macros.h"
#include "base/task/sequence_manager/time_domain.h" #include "base/task/sequence_manager/time_domain.h"
namespace base { namespace base {
...@@ -15,8 +14,10 @@ namespace internal { ...@@ -15,8 +14,10 @@ namespace internal {
class BASE_EXPORT RealTimeDomain : public TimeDomain { class BASE_EXPORT RealTimeDomain : public TimeDomain {
public: public:
RealTimeDomain(); RealTimeDomain() = default;
~RealTimeDomain() override; RealTimeDomain(const RealTimeDomain&) = delete;
RealTimeDomain& operator=(const RealTimeDomain&) = delete;
~RealTimeDomain() override = default;
// TimeDomain implementation: // TimeDomain implementation:
LazyNow CreateLazyNow() const override; LazyNow CreateLazyNow() const override;
...@@ -31,8 +32,6 @@ class BASE_EXPORT RealTimeDomain : public TimeDomain { ...@@ -31,8 +32,6 @@ class BASE_EXPORT RealTimeDomain : public TimeDomain {
private: private:
const TickClock* tick_clock_ = nullptr; const TickClock* tick_clock_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(RealTimeDomain);
}; };
} // namespace internal } // namespace internal
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
#define BASE_TASK_SEQUENCE_MANAGER_SEQUENCE_MANAGER_H_ #define BASE_TASK_SEQUENCE_MANAGER_SEQUENCE_MANAGER_H_
#include <memory> #include <memory>
#include <string>
#include <utility> #include <utility>
#include "base/macros.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/message_loop/timer_slack.h" #include "base/message_loop/timer_slack.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
...@@ -56,7 +56,8 @@ class BASE_EXPORT SequenceManager { ...@@ -56,7 +56,8 @@ class BASE_EXPORT SequenceManager {
struct MetricRecordingSettings { struct MetricRecordingSettings {
// This parameter will be updated for consistency on creation (setting // This parameter will be updated for consistency on creation (setting
// value to 0 when ThreadTicks are not supported). // value to 0 when ThreadTicks are not supported).
MetricRecordingSettings(double task_sampling_rate_for_recording_cpu_time); explicit MetricRecordingSettings(
double task_sampling_rate_for_recording_cpu_time);
// The proportion of the tasks for which the cpu time will be // The proportion of the tasks for which the cpu time will be
// sampled or 0 if this is not enabled. // sampled or 0 if this is not enabled.
...@@ -81,6 +82,8 @@ class BASE_EXPORT SequenceManager { ...@@ -81,6 +82,8 @@ class BASE_EXPORT SequenceManager {
class Builder; class Builder;
Settings(); Settings();
Settings(const Settings&) = delete;
Settings& operator=(const Settings&) = delete;
// In the future MessagePump (which is move-only) will also be a setting, // In the future MessagePump (which is move-only) will also be a setting,
// so we are making Settings move-only in preparation. // so we are making Settings move-only in preparation.
Settings(Settings&& move_from) noexcept; Settings(Settings&& move_from) noexcept;
...@@ -131,8 +134,6 @@ class BASE_EXPORT SequenceManager { ...@@ -131,8 +134,6 @@ class BASE_EXPORT SequenceManager {
int random_task_selection_seed = 0; int random_task_selection_seed = 0;
#endif // DCHECK_IS_ON() #endif // DCHECK_IS_ON()
DISALLOW_COPY_AND_ASSIGN(Settings);
}; };
virtual ~SequenceManager() = default; virtual ~SequenceManager() = default;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <memory> #include <memory>
#include <random> #include <random>
#include <set> #include <set>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
...@@ -18,7 +19,6 @@ ...@@ -18,7 +19,6 @@
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#include "base/containers/circular_deque.h" #include "base/containers/circular_deque.h"
#include "base/debug/crash_logging.h" #include "base/debug/crash_logging.h"
#include "base/macros.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
...@@ -80,6 +80,8 @@ class BASE_EXPORT SequenceManagerImpl ...@@ -80,6 +80,8 @@ class BASE_EXPORT SequenceManagerImpl
public: public:
using Observer = SequenceManager::Observer; using Observer = SequenceManager::Observer;
SequenceManagerImpl(const SequenceManagerImpl&) = delete;
SequenceManagerImpl& operator=(const SequenceManagerImpl&) = delete;
~SequenceManagerImpl() override; ~SequenceManagerImpl() override;
// Assume direct control over current thread and create a SequenceManager. // Assume direct control over current thread and create a SequenceManager.
...@@ -432,8 +434,6 @@ class BASE_EXPORT SequenceManagerImpl ...@@ -432,8 +434,6 @@ class BASE_EXPORT SequenceManagerImpl
} }
WeakPtrFactory<SequenceManagerImpl> weak_factory_{this}; WeakPtrFactory<SequenceManagerImpl> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(SequenceManagerImpl);
}; };
} // namespace internal } // namespace internal
......
...@@ -56,6 +56,8 @@ perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) { ...@@ -56,6 +56,8 @@ perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) {
class PerfTestTimeDomain : public MockTimeDomain { class PerfTestTimeDomain : public MockTimeDomain {
public: public:
PerfTestTimeDomain() : MockTimeDomain(TimeTicks::Now()) {} PerfTestTimeDomain() : MockTimeDomain(TimeTicks::Now()) {}
PerfTestTimeDomain(const PerfTestTimeDomain&) = delete;
PerfTestTimeDomain& operator=(const PerfTestTimeDomain&) = delete;
~PerfTestTimeDomain() override = default; ~PerfTestTimeDomain() override = default;
Optional<TimeDelta> DelayTillNextTask(LazyNow* lazy_now) override { Optional<TimeDelta> DelayTillNextTask(LazyNow* lazy_now) override {
...@@ -72,9 +74,6 @@ class PerfTestTimeDomain : public MockTimeDomain { ...@@ -72,9 +74,6 @@ class PerfTestTimeDomain : public MockTimeDomain {
if (NumberOfScheduledWakeUps() == 1u) if (NumberOfScheduledWakeUps() == 1u)
RequestDoWork(); RequestDoWork();
} }
private:
DISALLOW_COPY_AND_ASSIGN(PerfTestTimeDomain);
}; };
enum class PerfTestType { enum class PerfTestType {
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
...@@ -138,6 +137,8 @@ class BASE_EXPORT TaskQueue : public RefCountedThreadSafe<TaskQueue> { ...@@ -138,6 +137,8 @@ class BASE_EXPORT TaskQueue : public RefCountedThreadSafe<TaskQueue> {
// TODO(altimin): Make this private after TaskQueue/TaskQueueImpl refactoring. // TODO(altimin): Make this private after TaskQueue/TaskQueueImpl refactoring.
TaskQueue(std::unique_ptr<internal::TaskQueueImpl> impl, TaskQueue(std::unique_ptr<internal::TaskQueueImpl> impl,
const TaskQueue::Spec& spec); const TaskQueue::Spec& spec);
TaskQueue(const TaskQueue&) = delete;
TaskQueue& operator=(const TaskQueue&) = delete;
// Information about task execution. // Information about task execution.
// //
...@@ -381,8 +382,6 @@ class BASE_EXPORT TaskQueue : public RefCountedThreadSafe<TaskQueue> { ...@@ -381,8 +382,6 @@ class BASE_EXPORT TaskQueue : public RefCountedThreadSafe<TaskQueue> {
int enabled_voter_count_ = 0; int enabled_voter_count_ = 0;
int voter_count_ = 0; int voter_count_ = 0;
const char* name_; const char* name_;
DISALLOW_COPY_AND_ASSIGN(TaskQueue);
}; };
} // namespace sequence_manager } // namespace sequence_manager
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#include <memory> #include <memory>
#include <queue> #include <queue>
#include <set> #include <set>
#include <utility>
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/pending_task.h" #include "base/pending_task.h"
...@@ -74,6 +74,8 @@ class BASE_EXPORT TaskQueueImpl { ...@@ -74,6 +74,8 @@ class BASE_EXPORT TaskQueueImpl {
TimeDomain* time_domain, TimeDomain* time_domain,
const TaskQueue::Spec& spec); const TaskQueue::Spec& spec);
TaskQueueImpl(const TaskQueueImpl&) = delete;
TaskQueueImpl& operator=(const TaskQueueImpl&) = delete;
~TaskQueueImpl(); ~TaskQueueImpl();
// Types of queues TaskQueueImpl is maintaining internally. // Types of queues TaskQueueImpl is maintaining internally.
...@@ -308,6 +310,8 @@ class BASE_EXPORT TaskQueueImpl { ...@@ -308,6 +310,8 @@ class BASE_EXPORT TaskQueueImpl {
struct DelayedIncomingQueue { struct DelayedIncomingQueue {
public: public:
DelayedIncomingQueue(); DelayedIncomingQueue();
DelayedIncomingQueue(const DelayedIncomingQueue&) = delete;
DelayedIncomingQueue& operator=(const DelayedIncomingQueue&) = delete;
~DelayedIncomingQueue(); ~DelayedIncomingQueue();
void push(Task&& task); void push(Task&& task);
...@@ -336,8 +340,6 @@ class BASE_EXPORT TaskQueueImpl { ...@@ -336,8 +340,6 @@ class BASE_EXPORT TaskQueueImpl {
// Number of pending tasks in the queue that need high resolution timing. // Number of pending tasks in the queue that need high resolution timing.
int pending_high_res_tasks_ = 0; int pending_high_res_tasks_ = 0;
DISALLOW_COPY_AND_ASSIGN(DelayedIncomingQueue);
}; };
struct MainThreadOnly { struct MainThreadOnly {
...@@ -540,8 +542,6 @@ class BASE_EXPORT TaskQueueImpl { ...@@ -540,8 +542,6 @@ class BASE_EXPORT TaskQueueImpl {
const bool should_monitor_quiescence_; const bool should_monitor_quiescence_;
const bool should_notify_observers_; const bool should_notify_observers_;
const bool delayed_fence_allowed_; const bool delayed_fence_allowed_;
DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
}; };
} // namespace internal } // namespace internal
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include <stddef.h> #include <stddef.h>
#include <vector>
#include "base/base_export.h" #include "base/base_export.h"
#include "base/macros.h"
#include "base/pending_task.h" #include "base/pending_task.h"
#include "base/task/sequence_manager/sequence_manager.h" #include "base/task/sequence_manager/sequence_manager.h"
#include "base/task/sequence_manager/sequenced_task_source.h" #include "base/task/sequence_manager/sequenced_task_source.h"
...@@ -31,6 +32,8 @@ class BASE_EXPORT TaskQueueSelector : public WorkQueueSets::Observer { ...@@ -31,6 +32,8 @@ class BASE_EXPORT TaskQueueSelector : public WorkQueueSets::Observer {
TaskQueueSelector(scoped_refptr<AssociatedThreadId> associated_thread, TaskQueueSelector(scoped_refptr<AssociatedThreadId> associated_thread,
const SequenceManager::Settings& settings); const SequenceManager::Settings& settings);
TaskQueueSelector(const TaskQueueSelector&) = delete;
TaskQueueSelector& operator=(const TaskQueueSelector&) = delete;
~TaskQueueSelector() override; ~TaskQueueSelector() override;
// Called to register a queue that can be selected. This function is called // Called to register a queue that can be selected. This function is called
...@@ -253,7 +256,6 @@ class BASE_EXPORT TaskQueueSelector : public WorkQueueSets::Observer { ...@@ -253,7 +256,6 @@ class BASE_EXPORT TaskQueueSelector : public WorkQueueSets::Observer {
size_t immediate_starvation_count_ = 0; size_t immediate_starvation_count_ = 0;
Observer* task_queue_selector_observer_ = nullptr; // Not owned. Observer* task_queue_selector_observer_ = nullptr; // Not owned.
DISALLOW_COPY_AND_ASSIGN(TaskQueueSelector);
}; };
} // namespace internal } // namespace internal
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/pending_task.h" #include "base/pending_task.h"
#include "base/task/sequence_manager/enqueue_order_generator.h" #include "base/task/sequence_manager/enqueue_order_generator.h"
...@@ -37,12 +36,11 @@ namespace task_queue_selector_unittest { ...@@ -37,12 +36,11 @@ namespace task_queue_selector_unittest {
class MockObserver : public TaskQueueSelector::Observer { class MockObserver : public TaskQueueSelector::Observer {
public: public:
MockObserver() = default; MockObserver() = default;
MockObserver(const MockObserver&) = delete;
MockObserver& operator=(const MockObserver&) = delete;
~MockObserver() override = default; ~MockObserver() override = default;
MOCK_METHOD1(OnTaskQueueEnabled, void(internal::TaskQueueImpl*)); MOCK_METHOD1(OnTaskQueueEnabled, void(internal::TaskQueueImpl*));
private:
DISALLOW_COPY_AND_ASSIGN(MockObserver);
}; };
class TaskQueueSelectorForTest : public TaskQueueSelector { class TaskQueueSelectorForTest : public TaskQueueSelector {
...@@ -54,13 +52,14 @@ class TaskQueueSelectorForTest : public TaskQueueSelector { ...@@ -54,13 +52,14 @@ class TaskQueueSelectorForTest : public TaskQueueSelector {
using TaskQueueSelector::SetImmediateStarvationCountForTest; using TaskQueueSelector::SetImmediateStarvationCountForTest;
using TaskQueueSelector::SetOperationOldest; using TaskQueueSelector::SetOperationOldest;
TaskQueueSelectorForTest(scoped_refptr<AssociatedThreadId> associated_thread) explicit TaskQueueSelectorForTest(
scoped_refptr<AssociatedThreadId> associated_thread)
: TaskQueueSelector(associated_thread, SequenceManager::Settings()) {} : TaskQueueSelector(associated_thread, SequenceManager::Settings()) {}
}; };
class TaskQueueSelectorTest : public testing::Test { class TaskQueueSelectorTest : public testing::Test {
public: public:
explicit TaskQueueSelectorTest() TaskQueueSelectorTest()
: test_closure_(BindRepeating(&TaskQueueSelectorTest::TestFunction)), : test_closure_(BindRepeating(&TaskQueueSelectorTest::TestFunction)),
associated_thread_(AssociatedThreadId::CreateBound()), associated_thread_(AssociatedThreadId::CreateBound()),
selector_(associated_thread_) {} selector_(associated_thread_) {}
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_ #ifndef BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_
#define BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_ #define BASE_TASK_SEQUENCE_MANAGER_TASK_TIME_OBSERVER_H_
#include "base/macros.h"
#include "base/time/time.h" #include "base/time/time.h"
namespace base { namespace base {
...@@ -15,6 +14,8 @@ namespace sequence_manager { ...@@ -15,6 +14,8 @@ namespace sequence_manager {
class TaskTimeObserver { class TaskTimeObserver {
public: public:
TaskTimeObserver() = default; TaskTimeObserver() = default;
TaskTimeObserver(const TaskTimeObserver&) = delete;
TaskTimeObserver& operator=(const TaskTimeObserver&) = delete;
virtual ~TaskTimeObserver() = default; virtual ~TaskTimeObserver() = default;
// To be called when task is about to start. // To be called when task is about to start.
...@@ -22,9 +23,6 @@ class TaskTimeObserver { ...@@ -22,9 +23,6 @@ class TaskTimeObserver {
// To be called when task is completed. // To be called when task is completed.
virtual void DidProcessTask(TimeTicks start_time, TimeTicks end_time) = 0; virtual void DidProcessTask(TimeTicks start_time, TimeTicks end_time) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(TaskTimeObserver);
}; };
} // namespace sequence_manager } // namespace sequence_manager
......
...@@ -29,6 +29,8 @@ struct BASE_EXPORT PostedTask { ...@@ -29,6 +29,8 @@ struct BASE_EXPORT PostedTask {
Nestable nestable = Nestable::kNestable, Nestable nestable = Nestable::kNestable,
TaskType task_type = kTaskTypeNone); TaskType task_type = kTaskTypeNone);
PostedTask(PostedTask&& move_from) noexcept; PostedTask(PostedTask&& move_from) noexcept;
PostedTask(const PostedTask&) = delete;
PostedTask& operator=(const PostedTask&) = delete;
~PostedTask(); ~PostedTask();
OnceClosure callback; OnceClosure callback;
...@@ -41,8 +43,6 @@ struct BASE_EXPORT PostedTask { ...@@ -41,8 +43,6 @@ struct BASE_EXPORT PostedTask {
scoped_refptr<SequencedTaskRunner> task_runner; scoped_refptr<SequencedTaskRunner> task_runner;
// The time at which the task was queued. // The time at which the task was queued.
TimeTicks queue_time; TimeTicks queue_time;
DISALLOW_COPY_AND_ASSIGN(PostedTask);
}; };
// Represents a time at which a task wants to run. Tasks scheduled for the // Represents a time at which a task wants to run. Tasks scheduled for the
......
...@@ -15,6 +15,8 @@ namespace sequence_manager { ...@@ -15,6 +15,8 @@ namespace sequence_manager {
class MockTimeDomain : public TimeDomain { class MockTimeDomain : public TimeDomain {
public: public:
explicit MockTimeDomain(TimeTicks initial_now_ticks); explicit MockTimeDomain(TimeTicks initial_now_ticks);
MockTimeDomain(const MockTimeDomain&) = delete;
MockTimeDomain& operator=(const MockTimeDomain&) = delete;
~MockTimeDomain() override; ~MockTimeDomain() override;
void SetNowTicks(TimeTicks now_ticks); void SetNowTicks(TimeTicks now_ticks);
...@@ -29,8 +31,6 @@ class MockTimeDomain : public TimeDomain { ...@@ -29,8 +31,6 @@ class MockTimeDomain : public TimeDomain {
private: private:
TimeTicks now_ticks_; TimeTicks now_ticks_;
DISALLOW_COPY_AND_ASSIGN(MockTimeDomain);
}; };
} // namespace sequence_manager } // namespace sequence_manager
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
...@@ -32,6 +31,8 @@ class SequenceManagerImpl; ...@@ -32,6 +31,8 @@ class SequenceManagerImpl;
class BASE_EXPORT ThreadControllerImpl : public ThreadController, class BASE_EXPORT ThreadControllerImpl : public ThreadController,
public RunLoop::NestingObserver { public RunLoop::NestingObserver {
public: public:
ThreadControllerImpl(const ThreadControllerImpl&) = delete;
ThreadControllerImpl& operator=(const ThreadControllerImpl&) = delete;
~ThreadControllerImpl() override; ~ThreadControllerImpl() override;
// TODO(https://crbug.com/948051): replace |funneled_sequence_manager| with // TODO(https://crbug.com/948051): replace |funneled_sequence_manager| with
...@@ -127,8 +128,6 @@ class BASE_EXPORT ThreadControllerImpl : public ThreadController, ...@@ -127,8 +128,6 @@ class BASE_EXPORT ThreadControllerImpl : public ThreadController,
#endif #endif
WeakPtrFactory<ThreadControllerImpl> weak_factory_{this}; WeakPtrFactory<ThreadControllerImpl> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ThreadControllerImpl);
}; };
} // namespace internal } // namespace internal
......
...@@ -40,6 +40,10 @@ class BASE_EXPORT ThreadControllerWithMessagePumpImpl ...@@ -40,6 +40,10 @@ class BASE_EXPORT ThreadControllerWithMessagePumpImpl
ThreadControllerWithMessagePumpImpl( ThreadControllerWithMessagePumpImpl(
std::unique_ptr<MessagePump> message_pump, std::unique_ptr<MessagePump> message_pump,
const SequenceManager::Settings& settings); const SequenceManager::Settings& settings);
ThreadControllerWithMessagePumpImpl(
const ThreadControllerWithMessagePumpImpl&) = delete;
ThreadControllerWithMessagePumpImpl& operator=(
const ThreadControllerWithMessagePumpImpl&) = delete;
~ThreadControllerWithMessagePumpImpl() override; ~ThreadControllerWithMessagePumpImpl() override;
using ShouldScheduleWork = WorkDeduplicator::ShouldScheduleWork; using ShouldScheduleWork = WorkDeduplicator::ShouldScheduleWork;
...@@ -197,8 +201,6 @@ class BASE_EXPORT ThreadControllerWithMessagePumpImpl ...@@ -197,8 +201,6 @@ class BASE_EXPORT ThreadControllerWithMessagePumpImpl
// Reset at the start of each unit of work to cover the work itself and then // Reset at the start of each unit of work to cover the work itself and then
// transition to the next one. // transition to the next one.
base::Optional<HangWatchScopeEnabled> hang_watch_scope_; base::Optional<HangWatchScopeEnabled> hang_watch_scope_;
DISALLOW_COPY_AND_ASSIGN(ThreadControllerWithMessagePumpImpl);
}; };
} // namespace internal } // namespace internal
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/check.h" #include "base/check.h"
#include "base/macros.h"
#include "base/task/common/intrusive_heap.h" #include "base/task/common/intrusive_heap.h"
#include "base/task/sequence_manager/lazy_now.h" #include "base/task/sequence_manager/lazy_now.h"
#include "base/task/sequence_manager/task_queue_impl.h" #include "base/task/sequence_manager/task_queue_impl.h"
...@@ -36,6 +35,8 @@ class TaskQueueImpl; ...@@ -36,6 +35,8 @@ class TaskQueueImpl;
// into a global wake-up, which ultimately gets passed to the ThreadController. // into a global wake-up, which ultimately gets passed to the ThreadController.
class BASE_EXPORT TimeDomain { class BASE_EXPORT TimeDomain {
public: public:
TimeDomain(const TimeDomain&) = delete;
TimeDomain& operator=(const TimeDomain&) = delete;
virtual ~TimeDomain(); virtual ~TimeDomain();
// Returns LazyNow in TimeDomain's time. // Returns LazyNow in TimeDomain's time.
...@@ -152,7 +153,6 @@ class BASE_EXPORT TimeDomain { ...@@ -152,7 +153,6 @@ class BASE_EXPORT TimeDomain {
int pending_high_res_wake_up_count_ = 0; int pending_high_res_wake_up_count_ = 0;
scoped_refptr<internal::AssociatedThreadId> associated_thread_; scoped_refptr<internal::AssociatedThreadId> associated_thread_;
DISALLOW_COPY_AND_ASSIGN(TimeDomain);
}; };
} // namespace sequence_manager } // namespace sequence_manager
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <memory> #include <memory>
#include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_pump.h" #include "base/message_loop/message_pump.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
...@@ -39,6 +38,8 @@ class TestTimeDomain : public TimeDomain { ...@@ -39,6 +38,8 @@ class TestTimeDomain : public TimeDomain {
public: public:
TestTimeDomain() : now_(TimeTicks() + TimeDelta::FromSeconds(1)) {} TestTimeDomain() : now_(TimeTicks() + TimeDelta::FromSeconds(1)) {}
TestTimeDomain(const TestTimeDomain&) = delete;
TestTimeDomain& operator=(const TestTimeDomain&) = delete;
~TestTimeDomain() override = default; ~TestTimeDomain() override = default;
using TimeDomain::MoveReadyDelayedTasksToWorkQueues; using TimeDomain::MoveReadyDelayedTasksToWorkQueues;
...@@ -72,8 +73,6 @@ class TestTimeDomain : public TimeDomain { ...@@ -72,8 +73,6 @@ class TestTimeDomain : public TimeDomain {
private: private:
TimeTicks now_; TimeTicks now_;
DISALLOW_COPY_AND_ASSIGN(TestTimeDomain);
}; };
class TimeDomainTest : public testing::Test { class TimeDomainTest : public testing::Test {
......
...@@ -33,6 +33,8 @@ class BASE_EXPORT WorkQueue { ...@@ -33,6 +33,8 @@ class BASE_EXPORT WorkQueue {
// Note |task_queue| can be null if queue_type is kNonNestable. // Note |task_queue| can be null if queue_type is kNonNestable.
WorkQueue(TaskQueueImpl* task_queue, const char* name, QueueType queue_type); WorkQueue(TaskQueueImpl* task_queue, const char* name, QueueType queue_type);
WorkQueue(const WorkQueue&) = delete;
WorkQueue& operator=(const WorkQueue&) = delete;
~WorkQueue(); ~WorkQueue();
// Associates this work queue with the given work queue sets. This must be // Associates this work queue with the given work queue sets. This must be
...@@ -180,8 +182,6 @@ class BASE_EXPORT WorkQueue { ...@@ -180,8 +182,6 @@ class BASE_EXPORT WorkQueue {
const char* const name_; const char* const name_;
EnqueueOrder fence_; EnqueueOrder fence_;
const QueueType queue_type_; const QueueType queue_type_;
DISALLOW_COPY_AND_ASSIGN(WorkQueue);
}; };
} // namespace internal } // namespace internal
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <array> #include <array>
#include <map> #include <map>
#include <vector>
#include "base/base_export.h" #include "base/base_export.h"
#include "base/check_op.h" #include "base/check_op.h"
#include "base/macros.h"
#include "base/task/common/intrusive_heap.h" #include "base/task/common/intrusive_heap.h"
#include "base/task/sequence_manager/sequence_manager.h" #include "base/task/sequence_manager/sequence_manager.h"
#include "base/task/sequence_manager/task_queue_impl.h" #include "base/task/sequence_manager/task_queue_impl.h"
...@@ -41,6 +41,8 @@ class BASE_EXPORT WorkQueueSets { ...@@ -41,6 +41,8 @@ class BASE_EXPORT WorkQueueSets {
WorkQueueSets(const char* name, WorkQueueSets(const char* name,
Observer* observer, Observer* observer,
const SequenceManager::Settings& settings); const SequenceManager::Settings& settings);
WorkQueueSets(const WorkQueueSets&) = delete;
WorkQueueSets& operator=(const WorkQueueSets&) = delete;
~WorkQueueSets(); ~WorkQueueSets();
// O(log num queues) // O(log num queues)
...@@ -151,8 +153,6 @@ class BASE_EXPORT WorkQueueSets { ...@@ -151,8 +153,6 @@ class BASE_EXPORT WorkQueueSets {
#endif #endif
Observer* const observer_; Observer* const observer_;
DISALLOW_COPY_AND_ASSIGN(WorkQueueSets);
}; };
} // namespace internal } // namespace internal
......
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