1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
content / renderer / media / win / overlay_state_service_provider.h [blame]
// 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 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 gpu
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;
};
// Wrapper class for getting an OverlayStateService remote in the GPU
// process.
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;
// Returns true if the gpu channel is lost.
bool IsLost() const;
private:
OverlayStateServiceProviderImpl(const OverlayStateServiceProviderImpl&) =
delete;
OverlayStateServiceProviderImpl& operator=(
const OverlayStateServiceProviderImpl&) = delete;
~OverlayStateServiceProviderImpl() override;
scoped_refptr<gpu::GpuChannelHost> channel_;
};
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_WIN_OVERLAY_STATE_SERVICE_PROVIDER_H_