Commit a22e020d authored by Greg Kraynov's avatar Greg Kraynov Committed by Commit Bot

Remove TaskQueueManagerImpl::CreateLazyNow method.

Also avoid a hop to get own clock via the RealTimeDomain.

Bug: 857101
Change-Id: I0433f8442b061ff2b2f33f839eb08719fb76bc5d
Reviewed-on: https://chromium-review.googlesource.com/1118267Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Greg Kraynov <kraynov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571142}
parent 7fec26a6
...@@ -22,7 +22,7 @@ void RealTimeDomain::OnRegisterWithTaskQueueManager( ...@@ -22,7 +22,7 @@ void RealTimeDomain::OnRegisterWithTaskQueueManager(
} }
LazyNow RealTimeDomain::CreateLazyNow() const { LazyNow RealTimeDomain::CreateLazyNow() const {
return task_queue_manager_->CreateLazyNow(); return LazyNow(task_queue_manager_->GetTickClock());
} }
TimeTicks RealTimeDomain::Now() const { TimeTicks RealTimeDomain::Now() const {
......
...@@ -313,7 +313,7 @@ Optional<PendingTask> TaskQueueManagerImpl::TakeTask() { ...@@ -313,7 +313,7 @@ Optional<PendingTask> TaskQueueManagerImpl::TakeTask() {
// It's important we call ReloadEmptyWorkQueues out side of the lock to // It's important we call ReloadEmptyWorkQueues out side of the lock to
// avoid a lock order inversion. // avoid a lock order inversion.
ReloadEmptyWorkQueues(); ReloadEmptyWorkQueues();
LazyNow lazy_now(main_thread_only().real_time_domain->CreateLazyNow()); LazyNow lazy_now(controller_->GetClock());
WakeUpReadyDelayedQueues(&lazy_now); WakeUpReadyDelayedQueues(&lazy_now);
while (true) { while (true) {
...@@ -360,7 +360,7 @@ Optional<PendingTask> TaskQueueManagerImpl::TakeTask() { ...@@ -360,7 +360,7 @@ Optional<PendingTask> TaskQueueManagerImpl::TakeTask() {
} }
void TaskQueueManagerImpl::DidRunTask() { void TaskQueueManagerImpl::DidRunTask() {
LazyNow lazy_now(main_thread_only().real_time_domain->CreateLazyNow()); LazyNow lazy_now(controller_->GetClock());
ExecutingTask& executing_task = ExecutingTask& executing_task =
*main_thread_only().task_execution_stack.rbegin(); *main_thread_only().task_execution_stack.rbegin();
NotifyDidProcessTask(executing_task, &lazy_now); NotifyDidProcessTask(executing_task, &lazy_now);
...@@ -568,10 +568,6 @@ internal::EnqueueOrder TaskQueueManagerImpl::GetNextSequenceNumber() { ...@@ -568,10 +568,6 @@ internal::EnqueueOrder TaskQueueManagerImpl::GetNextSequenceNumber() {
return enqueue_order_generator_.GenerateNext(); return enqueue_order_generator_.GenerateNext();
} }
LazyNow TaskQueueManagerImpl::CreateLazyNow() const {
return LazyNow(controller_->GetClock());
}
std::unique_ptr<trace_event::ConvertableToTraceFormat> std::unique_ptr<trace_event::ConvertableToTraceFormat>
TaskQueueManagerImpl::AsValueWithSelectorResult( TaskQueueManagerImpl::AsValueWithSelectorResult(
bool should_run, bool should_run,
...@@ -579,7 +575,7 @@ TaskQueueManagerImpl::AsValueWithSelectorResult( ...@@ -579,7 +575,7 @@ TaskQueueManagerImpl::AsValueWithSelectorResult(
DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_);
std::unique_ptr<trace_event::TracedValue> state( std::unique_ptr<trace_event::TracedValue> state(
new trace_event::TracedValue()); new trace_event::TracedValue());
TimeTicks now = main_thread_only().real_time_domain->CreateLazyNow().Now(); TimeTicks now = NowTicks();
state->BeginArray("active_queues"); state->BeginArray("active_queues");
for (auto* const queue : main_thread_only().active_queues) for (auto* const queue : main_thread_only().active_queues)
queue->AsValueInto(now, state.get()); queue->AsValueInto(now, state.get());
......
...@@ -128,8 +128,6 @@ class PLATFORM_EXPORT TaskQueueManagerImpl ...@@ -128,8 +128,6 @@ class PLATFORM_EXPORT TaskQueueManagerImpl
void CancelDelayedWork(TimeDomain* requesting_time_domain, void CancelDelayedWork(TimeDomain* requesting_time_domain,
TimeTicks run_time); TimeTicks run_time);
LazyNow CreateLazyNow() const;
// Returns the currently executing TaskQueue if any. Must be called on the // Returns the currently executing TaskQueue if any. Must be called on the
// thread this class was created on. // thread this class was created on.
internal::TaskQueueImpl* currently_executing_task_queue() const; internal::TaskQueueImpl* currently_executing_task_queue() const;
......
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