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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/time_domain.h

Issue 2572893002: [Reland] Dont post delayed DoWork for disabled queues. (Closed)
Patch Set: Fix compile Created 3 years, 10 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 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Registers the |queue|. 104 // Registers the |queue|.
105 void RegisterQueue(internal::TaskQueueImpl* queue); 105 void RegisterQueue(internal::TaskQueueImpl* queue);
106 106
107 // Removes |queue| from all internal data structures. 107 // Removes |queue| from all internal data structures.
108 void UnregisterQueue(internal::TaskQueueImpl* queue); 108 void UnregisterQueue(internal::TaskQueueImpl* queue);
109 109
110 // Called by the TaskQueueManager when the TimeDomain is registered. 110 // Called by the TaskQueueManager when the TimeDomain is registered.
111 virtual void OnRegisterWithTaskQueueManager( 111 virtual void OnRegisterWithTaskQueueManager(
112 TaskQueueManager* task_queue_manager) = 0; 112 TaskQueueManager* task_queue_manager) = 0;
113 113
114 // The implementaion will secedule task processing to run with |delay| with 114 // The implementation will schedule task processing to run at time |run_time|
115 // respect to the TimeDomain's time source. Always called on the main thread. 115 // within the TimeDomain's time line. Only called from the main thread.
116 // NOTE this is only called by ScheduleDelayedWork if the scheduled runtime 116 // NOTE this is only called by ScheduleDelayedWork if the scheduled runtime
117 // is sooner than any previously sheduled work or if there is no other 117 // is sooner than any previously sheduled work or if there is no other
118 // scheduled work. 118 // scheduled work.
119 virtual void RequestWakeup(base::TimeTicks now, base::TimeDelta delay) = 0; 119 virtual void RequestWakeupAt(base::TimeTicks now,
120 base::TimeTicks run_time) = 0;
121
122 // The implementation will cancel a wake up previously requested by
123 // RequestWakeupAt. It's expected this will be a NOP for most virtual time
124 // domains.
125 virtual void CancelWakeupAt(base::TimeTicks run_time) = 0;
120 126
121 // For implementation specific tracing. 127 // For implementation specific tracing.
122 virtual void AsValueIntoInternal( 128 virtual void AsValueIntoInternal(
123 base::trace_event::TracedValue* state) const = 0; 129 base::trace_event::TracedValue* state) const = 0;
124 130
125 // Call TaskQueueImpl::UpdateDelayedWorkQueue for each queue where the delay 131 // Call TaskQueueImpl::UpdateDelayedWorkQueue for each queue where the delay
126 // has elapsed. 132 // has elapsed.
127 void WakeupReadyDelayedQueues(LazyNow* lazy_now); 133 void WakeupReadyDelayedQueues(LazyNow* lazy_now);
128 134
129 size_t NumberOfScheduledWakeups() const { 135 size_t NumberOfScheduledWakeups() const {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 167
162 base::ThreadChecker main_thread_checker_; 168 base::ThreadChecker main_thread_checker_;
163 169
164 DISALLOW_COPY_AND_ASSIGN(TimeDomain); 170 DISALLOW_COPY_AND_ASSIGN(TimeDomain);
165 }; 171 };
166 172
167 } // namespace scheduler 173 } // namespace scheduler
168 } // namespace blink 174 } // namespace blink
169 175
170 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ 176 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698