Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1659)

Side by Side Diff: services/ui/ws/gpu_client.h

Issue 2741343003: Update liftetime management of GpuClient (Closed)
Patch Set: fix x11 re-definition Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/DEPS ('k') | services/ui/ws/gpu_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_UI_WS_GPU_CLIENT_H_
6 #define SERVICES_UI_WS_GPU_CLIENT_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "gpu/config/gpu_info.h"
10 #include "services/ui/public/interfaces/gpu.mojom.h"
11
12 namespace ui {
13
14 namespace mojom {
15 class GpuService;
16 } // namespace mojom
17
18 class ServerGpuMemoryBufferManager;
19
20 namespace ws {
21
22 namespace test {
23 class GpuHostTest;
24 } // namespace test
25
26 // The implementation that relays requests from clients to the real
27 // service implementation in the GPU process over mojom.GpuService.
28 class GpuClient : public mojom::Gpu {
29 public:
30 GpuClient(int client_id,
31 gpu::GPUInfo* gpu_info,
32 ServerGpuMemoryBufferManager* gpu_memory_buffer_manager,
33 mojom::GpuService* gpu_service);
34 ~GpuClient() override;
35
36 private:
37 friend class test::GpuHostTest;
38
39 // EstablishGpuChannelCallback:
40 void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback,
41 mojo::ScopedMessagePipeHandle channel_handle);
42 // mojom::Gpu overrides:
43 void EstablishGpuChannel(
44 const EstablishGpuChannelCallback& callback) override;
45 void CreateGpuMemoryBuffer(
46 gfx::GpuMemoryBufferId id,
47 const gfx::Size& size,
48 gfx::BufferFormat format,
49 gfx::BufferUsage usage,
50 const mojom::Gpu::CreateGpuMemoryBufferCallback& callback) override;
51 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
52 const gpu::SyncToken& sync_token) override;
53
54 const int client_id_;
55
56 // The objects these pointers refer to are owned by the GpuHost object.
57 const gpu::GPUInfo* gpu_info_;
58 ServerGpuMemoryBufferManager* gpu_memory_buffer_manager_;
59 mojom::GpuService* gpu_service_;
60
61 base::WeakPtrFactory<GpuClient> weak_factory_;
62
63 DISALLOW_COPY_AND_ASSIGN(GpuClient);
64 };
65
66 } // namespace ws
67 } // namespace ui
68
69 #endif // SERVICES_UI_WS_GPU_CLIENT_H_
OLDNEW
« no previous file with comments | « services/ui/ws/DEPS ('k') | services/ui/ws/gpu_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698