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

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

Issue 1743813002: Revert of [cherrypick] Fix computation of runtime for throttled tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
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 unified diff | Download patch
« no previous file with comments | « components/scheduler/base/real_time_domain.cc ('k') | components/scheduler/base/time_domain.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/task_queue_impl.h" 5 #include "components/scheduler/base/task_queue_impl.h"
6 6
7 #include "components/scheduler/base/task_queue_manager.h" 7 #include "components/scheduler/base/task_queue_manager.h"
8 #include "components/scheduler/base/task_queue_manager_delegate.h" 8 #include "components/scheduler/base/task_queue_manager_delegate.h"
9 #include "components/scheduler/base/time_domain.h" 9 #include "components/scheduler/base/time_domain.h"
10 #include "components/scheduler/base/work_queue.h" 10 #include "components/scheduler/base/work_queue.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 bool TaskQueueImpl::PostDelayedTaskImpl( 142 bool TaskQueueImpl::PostDelayedTaskImpl(
143 const tracked_objects::Location& from_here, 143 const tracked_objects::Location& from_here,
144 const base::Closure& task, 144 const base::Closure& task,
145 base::TimeDelta delay, 145 base::TimeDelta delay,
146 TaskType task_type) { 146 TaskType task_type) {
147 base::AutoLock lock(any_thread_lock_); 147 base::AutoLock lock(any_thread_lock_);
148 if (!any_thread().task_queue_manager) 148 if (!any_thread().task_queue_manager)
149 return false; 149 return false;
150 LazyNow lazy_now(any_thread().time_domain->CreateLazyNow()); 150 LazyNow lazy_now(any_thread().time_domain->CreateLazyNow());
151 base::TimeTicks desired_run_time; 151 base::TimeTicks desired_run_time;
152 if (delay > base::TimeDelta()) { 152 if (delay > base::TimeDelta())
153 base::TimeTicks time_domain_now = lazy_now.Now(); 153 desired_run_time = lazy_now.Now() + delay;
154 desired_run_time =
155 any_thread().time_domain->ComputeDelayedRunTime(time_domain_now, delay);
156 }
157 return PostDelayedTaskLocked(&lazy_now, from_here, task, desired_run_time, 154 return PostDelayedTaskLocked(&lazy_now, from_here, task, desired_run_time,
158 task_type); 155 task_type);
159 } 156 }
160 157
161 bool TaskQueueImpl::PostDelayedTaskLocked( 158 bool TaskQueueImpl::PostDelayedTaskLocked(
162 LazyNow* lazy_now, 159 LazyNow* lazy_now,
163 const tracked_objects::Location& from_here, 160 const tracked_objects::Location& from_here,
164 const base::Closure& task, 161 const base::Closure& task,
165 base::TimeTicks desired_run_time, 162 base::TimeTicks desired_run_time,
166 TaskType task_type) { 163 TaskType task_type) {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 state->SetBoolean("nestable", task.nestable); 579 state->SetBoolean("nestable", task.nestable);
583 state->SetBoolean("is_high_res", task.is_high_res); 580 state->SetBoolean("is_high_res", task.is_high_res);
584 state->SetDouble( 581 state->SetDouble(
585 "delayed_run_time", 582 "delayed_run_time",
586 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L); 583 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L);
587 state->EndDictionary(); 584 state->EndDictionary();
588 } 585 }
589 586
590 } // namespace internal 587 } // namespace internal
591 } // namespace scheduler 588 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/base/real_time_domain.cc ('k') | components/scheduler/base/time_domain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698