chromium/chrome/browser/resource_coordinator/time.h

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TIME_H_
#define CHROME_BROWSER_RESOURCE_COORDINATOR_TIME_H_

#include "base/time/time.h"

namespace base {
class TickClock;
class Clock;
}

namespace resource_coordinator {

// Returns the current time. Obtained from the testing TickClock if set; from
// TimeTicks::Now() otherwise.
base::TimeTicks NowTicks();

// Returns the current time. Obtained from the testing clock if set; from
// Time::Now() otherwise.
base::Time Now();

// Returns the testing TickClock.
const base::TickClock* GetTickClock();

// Returns the testing Clock.
const base::Clock* GetClock();

// Sets the testing Clock and TickClock within its scope.
class ScopedSetClocksForTesting {};

}  // namespace resource_coordinator

#endif  // CHROME_BROWSER_RESOURCE_COORDINATOR_TIME_H_