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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2258133002: [scheduler] Implement time-based cpu throttling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use double instead of base::TimeTicks Created 4 years, 3 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
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index 71f4103a4b82445237f6de8c6352580d25c34611..016ea609f468449db0d039385b005a4298e7b0e2 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -149,6 +149,8 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
bool IsQueueEnabled() const override;
bool IsEmpty() const override;
bool HasPendingImmediateWork() const override;
+ base::Optional<base::TimeTicks> GetNextScheduledWakeUp() override;
+ base::Optional<base::TimeTicks> GetNextTaskRunTime() override;
alex clarke (OOO till 29th) 2016/09/12 17:45:26 I'm fine with adding GetNextScheduledWakeUp but I'
altimin 2016/09/14 11:23:15 I added a comment about this in TaskQueue itself,
void SetQueuePriority(QueuePriority priority) override;
QueuePriority GetQueuePriority() const override;
void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
@@ -293,6 +295,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
static void TaskAsValueInto(const Task& task,
base::trace_event::TracedValue* state);
+ // Same as public version, but uses given LazyNow.
+ bool HasPendingImmediateWork(LazyNow* lazy_now) const;
+
const base::PlatformThreadId thread_id_;
mutable base::Lock any_thread_lock_;

Powered by Google App Engine
This is Rietveld 408576698