| Index: components/scheduler/base/virtual_time_domain.h
|
| diff --git a/components/scheduler/base/virtual_time_domain.h b/components/scheduler/base/virtual_time_domain.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d913e6414b6e5607348fa629f59d6a6eb008cf5d
|
| --- /dev/null
|
| +++ b/components/scheduler/base/virtual_time_domain.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2015 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_BASE_VIRTUAL_TIME_DOMAIN_H_
|
| +#define COMPONENTS_SCHEDULER_BASE_VIRTUAL_TIME_DOMAIN_H_
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/macros.h"
|
| +#include "components/scheduler/base/time_domain.h"
|
| +#include "components/scheduler/scheduler_export.h"
|
| +
|
| +namespace scheduler {
|
| +class TaskQueueManagerDelegate;
|
| +
|
| +class SCHEDULER_EXPORT VirtualTimeDomain : public TimeDomain {
|
| + public:
|
| + VirtualTimeDomain(base::TimeTicks initial_time);
|
| +
|
| + // TimeDomain implementation:
|
| + LazyNow GetLazyNow() override;
|
| + bool MaybeAdvanceTime() override;
|
| + const char* GetName() const override;
|
| +
|
| + // Advances this time domain to |now|. NOTE |now| is supposed to be
|
| + // monotonically increasing.
|
| + void AdvanceTo(base::TimeTicks now);
|
| +
|
| + protected:
|
| + void RequestWakeup(base::TimeDelta delay) override;
|
| + void AsValueIntoInternal(
|
| + base::trace_event::TracedValue* state) const override;
|
| +
|
| + private:
|
| + base::TimeTicks now_;
|
| +
|
| + ~VirtualTimeDomain() override;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(VirtualTimeDomain);
|
| +};
|
| +
|
| +} // namespace scheduler
|
| +
|
| +#endif // COMPONENTS_SCHEDULER_BASE_VIRTUAL_TIME_DOMAIN_H_
|
|
|