OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 public: | 54 public: |
55 virtual ~GpuChannelHostFactory() {} | 55 virtual ~GpuChannelHostFactory() {} |
56 | 56 |
57 virtual bool IsMainThread() = 0; | 57 virtual bool IsMainThread() = 0; |
58 virtual scoped_refptr<base::SingleThreadTaskRunner> | 58 virtual scoped_refptr<base::SingleThreadTaskRunner> |
59 GetIOThreadTaskRunner() = 0; | 59 GetIOThreadTaskRunner() = 0; |
60 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; | 60 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; |
61 }; | 61 }; |
62 | 62 |
63 // Encapsulates an IPC channel between the client and one GPU process. | 63 // Encapsulates an IPC channel between the client and one GPU process. |
64 // On the GPU process side there's a corresponding GpuChannel. | 64 // On the GPU process side there's a corresponding gpu::GpuChannel. |
piman
2016/03/31 19:26:16
nit: this will conflict with https://codereview.ch
Mark Dittmer
2016/03/31 19:57:34
Done.
| |
65 // Every method can be called on any thread with a message loop, except for the | 65 // Every method can be called on any thread with a message loop, except for the |
66 // IO thread. | 66 // IO thread. |
67 class GpuChannelHost : public IPC::Sender, | 67 class GpuChannelHost : public IPC::Sender, |
68 public base::RefCountedThreadSafe<GpuChannelHost> { | 68 public base::RefCountedThreadSafe<GpuChannelHost> { |
69 public: | 69 public: |
70 // Must be called on the main thread (as defined by the factory). | 70 // Must be called on the main thread (as defined by the factory). |
71 static scoped_refptr<GpuChannelHost> Create( | 71 static scoped_refptr<GpuChannelHost> Create( |
72 GpuChannelHostFactory* factory, | 72 GpuChannelHostFactory* factory, |
73 int channel_id, | 73 int channel_id, |
74 const gpu::GPUInfo& gpu_info, | 74 const gpu::GPUInfo& gpu_info, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 mutable base::Lock context_lock_; | 290 mutable base::Lock context_lock_; |
291 scoped_ptr<IPC::SyncChannel> channel_; | 291 scoped_ptr<IPC::SyncChannel> channel_; |
292 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; | 292 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; |
293 | 293 |
294 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 294 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
295 }; | 295 }; |
296 | 296 |
297 } // namespace content | 297 } // namespace content |
298 | 298 |
299 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 299 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |