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

Unified Diff: components/scheduler/base/real_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 | « no previous file | components/scheduler/base/real_time_domain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/real_time_domain.h
diff --git a/components/scheduler/base/real_time_domain.h b/components/scheduler/base/real_time_domain.h
index f4f9ba80614bd3cc12d965be180a18980f5b9d65..f382fad3f0830527953f9bc8971effe4368d2d40 100644
--- a/components/scheduler/base/real_time_domain.h
+++ b/components/scheduler/base/real_time_domain.h
@@ -5,7 +5,8 @@
#ifndef COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
#define COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
-#include "base/callback.h"
+#include <set>
+
#include "base/macros.h"
#include "components/scheduler/base/time_domain.h"
#include "components/scheduler/scheduler_export.h"
@@ -15,8 +16,7 @@ class TaskQueueManagerDelegate;
class SCHEDULER_EXPORT RealTimeDomain : public TimeDomain {
public:
- RealTimeDomain(TaskQueueManagerDelegate* task_queue_manager_delegate,
- base::Closure do_work_closure);
+ RealTimeDomain();
// TimeDomain implementation:
LazyNow CreateLazyNow() override;
@@ -24,13 +24,21 @@ class SCHEDULER_EXPORT RealTimeDomain : public TimeDomain {
const char* GetName() const override;
protected:
- void RequestWakeup(base::TimeDelta delay) override;
+ void OnRegisterWithTaskQueueManager(
+ TaskQueueManagerDelegate* task_queue_manager_delegate,
+ base::Closure do_work_closure) override;
+ void RequestWakeup(LazyNow* lazy_now, base::TimeDelta delay) override;
void AsValueIntoInternal(
base::trace_event::TracedValue* state) const override;
private:
+ void PostWrappedDoWork(base::TimeTicks now, base::TimeTicks run_time);
+ void WrappedDoWorkTask(base::TimeTicks run_time);
+
TaskQueueManagerDelegate* task_queue_manager_delegate_; // NOT OWNED
+ std::set<base::TimeTicks> pending_wakeups_;
base::Closure do_work_closure_;
+ base::WeakPtrFactory<RealTimeDomain> weak_factory_;
~RealTimeDomain() override;
« no previous file with comments | « no previous file | components/scheduler/base/real_time_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698