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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2844223004: [scheduler] Always run task queue observer callback for delayed work. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | 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 "platform/scheduler/base/task_queue_impl.h" 5 #include "platform/scheduler/base/task_queue_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 void TaskQueueImpl::ScheduleDelayedWorkInTimeDomain(base::TimeTicks now) { 883 void TaskQueueImpl::ScheduleDelayedWorkInTimeDomain(base::TimeTicks now) {
884 if (!IsQueueEnabled()) 884 if (!IsQueueEnabled())
885 return; 885 return;
886 if (main_thread_only().delayed_incoming_queue.empty()) 886 if (main_thread_only().delayed_incoming_queue.empty())
887 return; 887 return;
888 888
889 main_thread_only().time_domain->ScheduleDelayedWork( 889 main_thread_only().time_domain->ScheduleDelayedWork(
890 this, main_thread_only().delayed_incoming_queue.top().delayed_wake_up(), 890 this, main_thread_only().delayed_incoming_queue.top().delayed_wake_up(),
891 now); 891 now);
892 892
893 if (!HasPendingImmediateWork()) { 893 NotifyWakeUpChangedOnMainThread(
894 NotifyWakeUpChangedOnMainThread( 894 main_thread_only().delayed_incoming_queue.top().delayed_run_time);
895 main_thread_only().delayed_incoming_queue.top().delayed_run_time);
896 }
897 } 895 }
898 896
899 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { 897 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) {
900 if (main_thread_only().observer) 898 if (main_thread_only().observer)
901 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); 899 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up);
902 } 900 }
903 901
904 } // namespace internal 902 } // namespace internal
905 } // namespace scheduler 903 } // namespace scheduler
906 } // namespace blink 904 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698