summaryrefslogtreecommitdiffstats
path: root/components/scheduler/renderer/throttled_time_domain.h
diff options
context:
space:
mode:
Diffstat (limited to 'components/scheduler/renderer/throttled_time_domain.h')
-rw-r--r--components/scheduler/renderer/throttled_time_domain.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/components/scheduler/renderer/throttled_time_domain.h b/components/scheduler/renderer/throttled_time_domain.h
new file mode 100644
index 0000000..f274e8c
--- /dev/null
+++ b/components/scheduler/renderer/throttled_time_domain.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SCHEDULER_RENDERER_THROTTLED_TIME_DOMAIN_H_
+#define COMPONENTS_SCHEDULER_RENDERER_THROTTLED_TIME_DOMAIN_H_
+
+#include "base/macros.h"
+#include "components/scheduler/base/virtual_time_domain.h"
+
+namespace scheduler {
+
+// A time domain that's mostly a VirtualTimeDomain except that real time is used
+// when computing the delayed runtime.
+class SCHEDULER_EXPORT ThrottledTimeDomain : public VirtualTimeDomain {
+ public:
+ ThrottledTimeDomain(TimeDomain::Observer* observer,
+ base::TickClock* tick_clock);
+ ~ThrottledTimeDomain() override;
+
+ // TimeDomain implementation:
+ base::TimeTicks ComputeDelayedRunTime(base::TimeTicks time_domain_now,
+ base::TimeDelta delay) const override;
+ const char* GetName() const override;
+
+ private:
+ base::TickClock* const tick_clock_; // NOT OWNED
+
+ DISALLOW_COPY_AND_ASSIGN(ThrottledTimeDomain);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_RENDERER_THROTTLED_TIME_DOMAIN_H_