chromium/extensions/browser/api/offscreen/audio_lifetime_enforcer.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 EXTENSIONS_BROWSER_API_OFFSCREEN_AUDIO_LIFETIME_ENFORCER_H_
#define EXTENSIONS_BROWSER_API_OFFSCREEN_AUDIO_LIFETIME_ENFORCER_H_

#include "base/auto_reset.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/api/offscreen/offscreen_document_lifetime_enforcer.h"

namespace extensions {

// The lifetime enforcer for an offscreen document playing audio. A document
// is considered inactive if a certain amount of time has passed without playing
// audio.
class AudioLifetimeEnforcer : public OffscreenDocumentLifetimeEnforcer,
                              public content::WebContentsObserver {};

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_API_OFFSCREEN_AUDIO_LIFETIME_ENFORCER_H_