chromium/third_party/blink/renderer/platform/peerconnection/vsync_tick_provider.h

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

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_VSYNC_TICK_PROVIDER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_VSYNC_TICK_PROVIDER_H_

#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/thread_annotations.h"
#include "base/time/time.h"
#include "third_party/blink/renderer/platform/peerconnection/vsync_provider.h"
#include "third_party/webrtc_overrides/metronome_source.h"
#include "third_party/webrtc_overrides/timer_based_tick_provider.h"

namespace blink {

// Tick provider that normally generates ticks based on callbacks from VSync
// notifications requested from a VSyncProvider. If VSyncs cease to be reported
// (such as when the tab is occluded), ticks are instead provided by a supplied
// default tick provider. When VSyncs are found to be reported again, the class
// switches back to be driven by them.
//
// After construction, all access including destruction must happen on the
// `sequence` specified on construction.
class PLATFORM_EXPORT VSyncTickProvider : public MetronomeSource::TickProvider {};
}  // namespace blink
#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_VSYNC_TICK_PROVIDER_H_