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

Unified Diff: components/scheduler/base/time_domain.h

Issue 1441073006: Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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: components/scheduler/base/time_domain.h
diff --git a/components/scheduler/base/time_domain.h b/components/scheduler/base/time_domain.h
index 476a68eb5f4299f78b66d2b069fef24320a1b37a..3bf7b61aa5e30de69d2c279a40d70b6694c81f8a 100644
--- a/components/scheduler/base/time_domain.h
+++ b/components/scheduler/base/time_domain.h
@@ -25,7 +25,19 @@ class TaskQueueManagerDelegate;
class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
public:
- TimeDomain();
+ class SCHEDULER_EXPORT Observer {
+ public:
+ virtual ~Observer() {}
+
+ // Called when RegisterAsUpdatableTaskQueue is called. Can fire from any
Sami 2015/11/25 17:12:25 nit: these two comments don't really make sense un
alex clarke (OOO till 29th) 2015/11/26 18:43:27 Done.
+ // thread.
+ virtual void OnTimeDomainHasImmediateWork() = 0;
+
+ // Called when RequestWakeup is called. Called only from the main thread.
+ virtual void OnTimeDomainHasDelayedWork() = 0;
+ };
+
+ explicit TimeDomain(Observer* observer);
// Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from
// any thread.
@@ -115,6 +127,8 @@ class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
// only be accessed from the main thread.
std::set<internal::TaskQueueImpl*> updatable_queue_set_;
+ Observer* observer_;
+
base::ThreadChecker main_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(TimeDomain);

Powered by Google App Engine
This is Rietveld 408576698