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

Unified Diff: components/scheduler/child/scheduler_tqm_delegate_impl.h

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink 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/child/scheduler_tqm_delegate_impl.h
diff --git a/components/scheduler/child/scheduler_task_runner_delegate_impl.h b/components/scheduler/child/scheduler_tqm_delegate_impl.h
similarity index 55%
copy from components/scheduler/child/scheduler_task_runner_delegate_impl.h
copy to components/scheduler/child/scheduler_tqm_delegate_impl.h
index 2f18b992c68728bbdd47c47a32e3bbf9c128098e..23c378c571f1a86915f1a8330e6ddd45d5ca5abb 100644
--- a/components/scheduler/child/scheduler_task_runner_delegate_impl.h
+++ b/components/scheduler/child/scheduler_tqm_delegate_impl.h
@@ -2,23 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_IMPL_H_
-#define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_IMPL_H_
+#ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGATE_IMPL_H_
+#define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGATE_IMPL_H_
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
-#include "components/scheduler/child/scheduler_task_runner_delegate.h"
+#include "base/time/tick_clock.h"
+#include "components/scheduler/child/scheduler_tqm_delegate.h"
#include "components/scheduler/scheduler_export.h"
namespace scheduler {
-class SCHEDULER_EXPORT SchedulerTaskRunnerDelegateImpl
- : public SchedulerTaskRunnerDelegate {
+class SCHEDULER_EXPORT SchedulerTqmDelegateImpl : public SchedulerTqmDelegate {
public:
// |message_loop| is not owned and must outlive the lifetime of this object.
- static scoped_refptr<SchedulerTaskRunnerDelegateImpl> Create(
- base::MessageLoop* message_loop);
+ static scoped_refptr<SchedulerTqmDelegateImpl> Create(
+ base::MessageLoop* message_loop,
+ scoped_ptr<base::TickClock> time_source);
- // SchedulerTaskRunnerDelegate implementation
+ // SchedulerTqmDelegate implementation
void SetDefaultTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
void RestoreDefaultTaskRunner() override;
@@ -30,20 +32,24 @@ class SCHEDULER_EXPORT SchedulerTaskRunnerDelegateImpl
base::TimeDelta delay) override;
bool RunsTasksOnCurrentThread() const override;
bool IsNested() const override;
+ base::TimeTicks NowTicks() override;
+ void OnNoMoreImmediateWork() override;
protected:
- ~SchedulerTaskRunnerDelegateImpl() override;
+ ~SchedulerTqmDelegateImpl() override;
private:
- explicit SchedulerTaskRunnerDelegateImpl(base::MessageLoop* message_loop);
+ SchedulerTqmDelegateImpl(base::MessageLoop* message_loop,
+ scoped_ptr<base::TickClock> time_source);
// Not owned.
base::MessageLoop* message_loop_;
scoped_refptr<SingleThreadTaskRunner> message_loop_task_runner_;
+ scoped_ptr<base::TickClock> time_source_;
- DISALLOW_COPY_AND_ASSIGN(SchedulerTaskRunnerDelegateImpl);
+ DISALLOW_COPY_AND_ASSIGN(SchedulerTqmDelegateImpl);
};
} // namespace scheduler
-#endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_IMPL_H_
+#endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGATE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698