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

Side by Side Diff: components/scheduler/base/time_domain.cc

Issue 1898233002: Report expected task queueing time via UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove export. Fix windows. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/scheduler/base/time_domain.h" 5 #include "components/scheduler/base/time_domain.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "components/scheduler/base/task_queue_impl.h" 9 #include "components/scheduler/base/task_queue_impl.h"
10 #include "components/scheduler/base/task_queue_manager_delegate.h" 10 #include "components/scheduler/base/task_queue_manager_delegate.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 newly_updatable_[i] = newly_updatable_.back(); 103 newly_updatable_[i] = newly_updatable_.back();
104 newly_updatable_.pop_back(); 104 newly_updatable_.pop_back();
105 } else { 105 } else {
106 i++; 106 i++;
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 void TimeDomain::UpdateWorkQueues( 111 void TimeDomain::UpdateWorkQueues(
112 bool should_trigger_wakeup, 112 bool should_trigger_wakeup,
113 const internal::TaskQueueImpl::Task* previous_task) { 113 const internal::TaskQueueImpl::Task* previous_task,
114 LazyNow lazy_now) {
114 DCHECK(main_thread_checker_.CalledOnValidThread()); 115 DCHECK(main_thread_checker_.CalledOnValidThread());
115 LazyNow lazy_now(CreateLazyNow());
116 116
117 // Move any ready delayed tasks into the Incoming queues. 117 // Move any ready delayed tasks into the Incoming queues.
118 WakeupReadyDelayedQueues(&lazy_now, should_trigger_wakeup, previous_task); 118 WakeupReadyDelayedQueues(&lazy_now, should_trigger_wakeup, previous_task);
119 119
120 MoveNewlyUpdatableQueuesIntoUpdatableQueueSet(); 120 MoveNewlyUpdatableQueuesIntoUpdatableQueueSet();
121 121
122 auto iter = updatable_queue_set_.begin(); 122 auto iter = updatable_queue_set_.begin();
123 while (iter != updatable_queue_set_.end()) { 123 while (iter != updatable_queue_set_.end()) {
124 internal::TaskQueueImpl* queue = *iter++; 124 internal::TaskQueueImpl* queue = *iter++;
125 // NOTE Update work queue may erase itself from |updatable_queue_set_|. 125 // NOTE Update work queue may erase itself from |updatable_queue_set_|.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 state->SetInteger("registered_delay_count", delayed_wakeup_multimap_.size()); 206 state->SetInteger("registered_delay_count", delayed_wakeup_multimap_.size());
207 if (!delayed_wakeup_multimap_.empty()) { 207 if (!delayed_wakeup_multimap_.empty()) {
208 base::TimeDelta delay = delayed_wakeup_multimap_.begin()->first - Now(); 208 base::TimeDelta delay = delayed_wakeup_multimap_.begin()->first - Now();
209 state->SetDouble("next_delay_ms", delay.InMillisecondsF()); 209 state->SetDouble("next_delay_ms", delay.InMillisecondsF());
210 } 210 }
211 AsValueIntoInternal(state); 211 AsValueIntoInternal(state);
212 state->EndDictionary(); 212 state->EndDictionary();
213 } 213 }
214 214
215 } // namespace scheduler 215 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/base/time_domain.h ('k') | components/scheduler/base/time_domain_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698