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

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

Issue 1468443002: Reduce the number of delayed tasks on chromium run loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Weak pointer 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_manager_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 b01f05d907f45c1cdeb27bfa5324f213750adb08..476a68eb5f4299f78b66d2b069fef24320a1b37a 100644
--- a/components/scheduler/base/time_domain.h
+++ b/components/scheduler/base/time_domain.h
@@ -7,6 +7,7 @@
#include <map>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -20,6 +21,7 @@ namespace internal {
class TaskQueueImpl;
} // internal
class TaskQueueManager;
+class TaskQueueManagerDelegate;
class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
public:
@@ -79,9 +81,14 @@ class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
void UpdateWorkQueues(bool should_trigger_wakeup,
const internal::TaskQueueImpl::Task* previous_task);
+ // Called by the TaskQueueManager when the TimeDomain is registered.
+ virtual void OnRegisterWithTaskQueueManager(
+ TaskQueueManagerDelegate* task_queue_manager_delegate,
+ base::Closure do_work_closure) = 0;
+
// The implementaion will secedule task processing to run with |delay| with
// respect to the TimeDomain's time source.
- virtual void RequestWakeup(base::TimeDelta delay) = 0;
+ virtual void RequestWakeup(LazyNow* lazy_now, base::TimeDelta delay) = 0;
// For implementation specific tracing.
virtual void AsValueIntoInternal(
@@ -109,7 +116,6 @@ class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> {
std::set<internal::TaskQueueImpl*> updatable_queue_set_;
base::ThreadChecker main_thread_checker_;
- base::WeakPtrFactory<TimeDomain> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(TimeDomain);
};
« no previous file with comments | « components/scheduler/base/task_queue_manager_unittest.cc ('k') | components/scheduler/base/time_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698