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_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 static void Initialize(bool establish_gpu_channel); | 29 static void Initialize(bool establish_gpu_channel); |
30 static void Terminate(); | 30 static void Terminate(); |
31 static BrowserGpuChannelHostFactory* instance() { return instance_; } | 31 static BrowserGpuChannelHostFactory* instance() { return instance_; } |
32 | 32 |
33 // Overridden from gpu::GpuChannelHostFactory: | 33 // Overridden from gpu::GpuChannelHostFactory: |
34 bool IsMainThread() override; | 34 bool IsMainThread() override; |
35 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 35 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
36 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 36 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
37 size_t size) override; | 37 size_t size) override; |
38 | 38 |
39 int GpuProcessHostId() { return gpu_host_id_; } | |
40 gpu::GpuChannelHost* GetGpuChannel(); | 39 gpu::GpuChannelHost* GetGpuChannel(); |
41 int GetGpuChannelId() { return gpu_client_id_; } | 40 int GetGpuChannelId() { return gpu_client_id_; } |
42 | 41 |
43 // Closes the channel to the GPU process. This should be called before the IO | 42 // Closes the channel to the GPU process. This should be called before the IO |
44 // thread stops. | 43 // thread stops. |
45 void CloseChannel(); | 44 void CloseChannel(); |
46 | 45 |
47 // Used to skip GpuChannelHost tests when there can be no GPU process. | 46 // Used to skip GpuChannelHost tests when there can be no GPU process. |
48 static bool CanUseForTesting(); | 47 static bool CanUseForTesting(); |
49 | 48 |
(...skipping 15 matching lines...) Expand all Loading... |
65 void GpuChannelEstablished(); | 64 void GpuChannelEstablished(); |
66 | 65 |
67 static void InitializeShaderDiskCacheOnIO(int gpu_client_id, | 66 static void InitializeShaderDiskCacheOnIO(int gpu_client_id, |
68 const base::FilePath& cache_dir); | 67 const base::FilePath& cache_dir); |
69 | 68 |
70 const int gpu_client_id_; | 69 const int gpu_client_id_; |
71 const uint64_t gpu_client_tracing_id_; | 70 const uint64_t gpu_client_tracing_id_; |
72 std::unique_ptr<base::WaitableEvent> shutdown_event_; | 71 std::unique_ptr<base::WaitableEvent> shutdown_event_; |
73 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; | 72 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
74 std::unique_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 73 std::unique_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
75 int gpu_host_id_; | |
76 scoped_refptr<EstablishRequest> pending_request_; | 74 scoped_refptr<EstablishRequest> pending_request_; |
77 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; | 75 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; |
78 | 76 |
79 static BrowserGpuChannelHostFactory* instance_; | 77 static BrowserGpuChannelHostFactory* instance_; |
80 | 78 |
81 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 79 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
82 }; | 80 }; |
83 | 81 |
84 } // namespace content | 82 } // namespace content |
85 | 83 |
86 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 84 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
OLD | NEW |