chromium/gpu/command_buffer/service/retaining_one_shot_timer_holder.h

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

#ifndef GPU_COMMAND_BUFFER_SERVICE_RETAINING_ONE_SHOT_TIMER_HOLDER_H_
#define GPU_COMMAND_BUFFER_SERVICE_RETAINING_ONE_SHOT_TIMER_HOLDER_H_

#include <memory>

#include "base/functional/callback.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "gpu/gpu_export.h"

namespace base {
class SingleThreadTaskRunner;
}

namespace gpu {

// This class holds a RetainingOneShotTimer and ensures thread safety.
// The public methods are safe to call from any threads.
// Before the object is destructed, DestroyTimer() must be called to clean up.
class GPU_EXPORT RetainingOneShotTimerHolder
    : public base::RefCountedThreadSafe<RetainingOneShotTimerHolder> {};

}  // namespace gpu

#endif  // GPU_COMMAND_BUFFER_SERVICE_RETAINING_ONE_SHOT_TIMER_HOLDER_H_