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

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

Issue 1477353002: Revert of Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « components/scheduler/base/task_queue_sets_unittest.cc ('k') | components/scheduler/base/time_domain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/time_domain.h
diff --git a/components/scheduler/base/time_domain.h b/components/scheduler/base/time_domain.h
index 5cf39b709d11c09c47564c78a3f849565f6e7430..476a68eb5f4299f78b66d2b069fef24320a1b37a 100644
--- a/components/scheduler/base/time_domain.h
+++ b/components/scheduler/base/time_domain.h
@@ -23,24 +23,9 @@
class TaskQueueManager;
class TaskQueueManagerDelegate;
-class SCHEDULER_EXPORT TimeDomain {
+class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
public:
- class SCHEDULER_EXPORT Observer {
- public:
- virtual ~Observer() {}
-
- // Called when an empty TaskQueue registered with this TimeDomain has a task
- // enqueued.
- virtual void OnTimeDomainHasImmediateWork() = 0;
-
- // Called when a TaskQueue registered with this TimeDomain has a delayed
- // task enqueued and no other delayed tasks associated with this TimeDomain
- // are pending.
- virtual void OnTimeDomainHasDelayedWork() = 0;
- };
-
- explicit TimeDomain(Observer* observer);
- virtual ~TimeDomain();
+ TimeDomain();
// Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from
// any thread.
@@ -61,6 +46,9 @@
protected:
friend class internal::TaskQueueImpl;
friend class TaskQueueManager;
+ friend class base::RefCounted<TimeDomain>;
+
+ virtual ~TimeDomain();
void AsValueInto(base::trace_event::TracedValue* state) const;
@@ -81,9 +69,6 @@
void ScheduleDelayedWork(internal::TaskQueueImpl* queue,
base::TimeTicks delayed_run_time,
LazyNow* lazy_now);
-
- // Registers the |queue|.
- void RegisterQueue(internal::TaskQueueImpl* queue);
// Removes |queue| from the set of task queues that UpdateWorkQueues calls
// UpdateWorkQueue on.
@@ -130,10 +115,6 @@
// only be accessed from the main thread.
std::set<internal::TaskQueueImpl*> updatable_queue_set_;
- std::set<internal::TaskQueueImpl*> registered_task_queues_;
-
- Observer* observer_;
-
base::ThreadChecker main_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(TimeDomain);
« no previous file with comments | « components/scheduler/base/task_queue_sets_unittest.cc ('k') | components/scheduler/base/time_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698