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

Unified Diff: components/scheduler/child/task_queue_impl.cc

Issue 1303353003: scheduler: Disable expensive timers during main thread user input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 4 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/child/task_queue_impl.h ('k') | components/scheduler/child/task_queue_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/task_queue_impl.cc
diff --git a/components/scheduler/child/task_queue_impl.cc b/components/scheduler/child/task_queue_impl.cc
index f60a8e8509eef57a32b3bb9fabe7cd26becee989..556332b2f9b98cadddff2e0b94e3fe0b31d1466a 100644
--- a/components/scheduler/child/task_queue_impl.cc
+++ b/components/scheduler/child/task_queue_impl.cc
@@ -437,6 +437,34 @@ void TaskQueueImpl::AsValueInto(base::trace_event::TracedValue* state) const {
state->EndDictionary();
}
+void TaskQueueImpl::AddTaskObserver(
+ base::MessageLoop::TaskObserver* task_observer) {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ task_observers_.AddObserver(task_observer);
+}
+
+void TaskQueueImpl::RemoveTaskObserver(
+ base::MessageLoop::TaskObserver* task_observer) {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ task_observers_.RemoveObserver(task_observer);
+}
+
+void TaskQueueImpl::NotifyWillProcessTask(
+ const base::PendingTask& pending_task) {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ DCHECK(should_notify_observers_);
+ FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_,
+ WillProcessTask(pending_task));
+}
+
+void TaskQueueImpl::NotifyDidProcessTask(
+ const base::PendingTask& pending_task) {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ DCHECK(should_notify_observers_);
+ FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_,
+ DidProcessTask(pending_task));
+}
+
// static
void TaskQueueImpl::QueueAsValueInto(const std::queue<Task>& queue,
base::trace_event::TracedValue* state) {
« no previous file with comments | « components/scheduler/child/task_queue_impl.h ('k') | components/scheduler/child/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698