#ifndef CONTENT_RENDERER_MEDIA_WIN_OVERLAY_STATE_SERVICE_PROVIDER_H_
#define CONTENT_RENDERER_MEDIA_WIN_OVERLAY_STATE_SERVICE_PROVIDER_H_
#include "base/memory/ref_counted.h"
#include "gpu/ipc/common/gpu_channel.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
namespace gpu {
class GpuChannelHost;
}
namespace content {
class OverlayStateServiceProvider
: public base::RefCountedThreadSafe<OverlayStateServiceProvider> {
public:
virtual bool RegisterObserver(
mojo::PendingRemote<gpu::mojom::OverlayStateObserver> pending_remote,
const gpu::Mailbox& mailbox) = 0;
protected:
friend class base::RefCountedThreadSafe<OverlayStateServiceProvider>;
OverlayStateServiceProvider() = default;
OverlayStateServiceProvider(const OverlayStateServiceProvider&) = delete;
OverlayStateServiceProvider& operator=(const OverlayStateServiceProvider&) =
delete;
virtual ~OverlayStateServiceProvider() = default;
};
class OverlayStateServiceProviderImpl : public OverlayStateServiceProvider {
public:
explicit OverlayStateServiceProviderImpl(
scoped_refptr<gpu::GpuChannelHost> channel);
bool RegisterObserver(
mojo::PendingRemote<gpu::mojom::OverlayStateObserver> pending_remote,
const gpu::Mailbox& mailbox) override;
bool IsLost() const;
private:
OverlayStateServiceProviderImpl(const OverlayStateServiceProviderImpl&) =
delete;
OverlayStateServiceProviderImpl& operator=(
const OverlayStateServiceProviderImpl&) = delete;
~OverlayStateServiceProviderImpl() override;
scoped_refptr<gpu::GpuChannelHost> channel_;
};
}
#endif