Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1379)

Unified Diff: components/scheduler/base/time_domain.cc

Issue 1855453002: Remove registered_task_queues_ and associated DCHECKS from TimeDomain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/scheduler/base/time_domain.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/time_domain.cc
diff --git a/components/scheduler/base/time_domain.cc b/components/scheduler/base/time_domain.cc
index 5932adca954d3636311f7e1a4b388f2be3f718a9..61851c533ea81f7c48e16f0dfd0a11c4f6e6fe29 100644
--- a/components/scheduler/base/time_domain.cc
+++ b/components/scheduler/base/time_domain.cc
@@ -17,26 +17,17 @@ TimeDomain::TimeDomain(Observer* observer) : observer_(observer) {}
TimeDomain::~TimeDomain() {
DCHECK(main_thread_checker_.CalledOnValidThread());
-#if DCHECK_IS_ON()
- DCHECK(registered_task_queues_.empty());
-#endif
}
void TimeDomain::RegisterQueue(internal::TaskQueueImpl* queue) {
DCHECK(main_thread_checker_.CalledOnValidThread());
DCHECK_EQ(queue->GetTimeDomain(), this);
-#if DCHECK_IS_ON()
- registered_task_queues_.insert(queue);
-#endif
}
void TimeDomain::UnregisterQueue(internal::TaskQueueImpl* queue) {
DCHECK(main_thread_checker_.CalledOnValidThread());
DCHECK_EQ(queue->GetTimeDomain(), this);
UnregisterAsUpdatableTaskQueue(queue);
-#if DCHECK_IS_ON()
- registered_task_queues_.erase(queue);
-#endif
// We need to remove |task_queue| from delayed_wakeup_multimap_ which is a
// little awkward since it's keyed by time. O(n) running time.
@@ -57,14 +48,6 @@ void TimeDomain::MigrateQueue(internal::TaskQueueImpl* queue,
DCHECK_EQ(queue->GetTimeDomain(), this);
DCHECK(destination_time_domain);
UnregisterAsUpdatableTaskQueue(queue);
-#if DCHECK_IS_ON()
- DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end());
- registered_task_queues_.erase(queue);
-
- // NOTE it's the responsibility of the caller to make sure
- // |queue->GetTimeDomain()| is updated.
- destination_time_domain->registered_task_queues_.insert(queue);
-#endif
base::TimeTicks destination_now = destination_time_domain->Now();
// We need to remove |task_queue| from delayed_wakeup_multimap_ which is a
@@ -86,9 +69,6 @@ void TimeDomain::ScheduleDelayedWork(internal::TaskQueueImpl* queue,
base::TimeTicks delayed_run_time,
base::TimeTicks now) {
DCHECK(main_thread_checker_.CalledOnValidThread());
-#if DCHECK_IS_ON()
- DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end());
-#endif
if (delayed_wakeup_multimap_.empty() ||
delayed_run_time < delayed_wakeup_multimap_.begin()->first) {
base::TimeDelta delay = std::max(base::TimeDelta(), delayed_run_time - now);
@@ -101,9 +81,6 @@ void TimeDomain::ScheduleDelayedWork(internal::TaskQueueImpl* queue,
}
void TimeDomain::RegisterAsUpdatableTaskQueue(internal::TaskQueueImpl* queue) {
-#if DCHECK_IS_ON()
- DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end());
-#endif
{
base::AutoLock lock(newly_updatable_lock_);
newly_updatable_.push_back(queue);
@@ -114,9 +91,6 @@ void TimeDomain::RegisterAsUpdatableTaskQueue(internal::TaskQueueImpl* queue) {
void TimeDomain::UnregisterAsUpdatableTaskQueue(
internal::TaskQueueImpl* queue) {
-#if DCHECK_IS_ON()
- DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end());
-#endif
DCHECK(main_thread_checker_.CalledOnValidThread());
updatable_queue_set_.erase(queue);
« no previous file with comments | « components/scheduler/base/time_domain.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698