OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CONTENT_COMMON_GPU_CLIENT_GPU_ARC_ACCELERATOR_HOST_H_ | |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_ARC_ACCELERATOR_HOST_H_ | |
7 | |
8 #include <queue> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/memory/weak_ptr.h" | |
12 #include "base/threading/non_thread_safe.h" | |
13 #include "ipc/ipc_channel_handle.h" | |
14 #include "ipc/ipc_listener.h" | |
15 | |
16 namespace content { | |
17 class GpuChannelHost; | |
18 | |
19 // kcwu: Should this class be folded into GpuProcessHost? | |
Owen Lin
2015/11/23 05:31:06
TODO(kcwu)?
Sounds good to me.
kcwu
2015/11/23 08:11:48
Now the object calling relationship is
(browser si
| |
20 class GpuArcAcceleratorHost | |
21 : public IPC::Listener, | |
22 public base::NonThreadSafe, | |
23 public base::SupportsWeakPtr<GpuArcAcceleratorHost> { | |
24 public: | |
25 using CreatedCallback = base::Callback<void(IPC::ChannelHandle, uint32_t)>; | |
26 GpuArcAcceleratorHost(); | |
27 ~GpuArcAcceleratorHost() override; | |
28 | |
29 // IPC::Listener implementation. | |
30 void OnChannelError() override; | |
31 bool OnMessageReceived(const IPC::Message& message) override; | |
32 | |
33 void CreateArcAccelerator(uint32_t device_type, const CreatedCallback& cb); | |
Owen Lin
2015/11/23 05:31:06
Why need to pass device_type. I would we will do t
kcwu
2015/11/23 08:11:48
The main reason is I want to reduce one IPC round
| |
34 void Shutdown(); | |
35 | |
36 private: | |
37 void AbortPendingRequests(); | |
38 void GpuChannelEstablished(uint32_t device_type, const CreatedCallback& cb); | |
39 void CreateArcAcceleratorWithGpuChannel(uint32_t device_type, | |
40 const CreatedCallback& cb); | |
41 | |
42 void OnArcAcceleratorCreated(IPC::ChannelHandle handle, uint32_t result); | |
43 | |
44 int32_t route_id_; | |
45 scoped_refptr<GpuChannelHost> gpu_channel_host_; | |
46 std::queue<CreatedCallback> pending_requests_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(GpuArcAcceleratorHost); | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_ARC_ACCELERATOR_HOST_H_ | |
OLD | NEW |