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 22 matching lines...) Expand all Loading... |
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_; } | 39 int GpuProcessHostId() { return gpu_host_id_; } |
40 gpu::GpuChannelHost* GetGpuChannel(); | 40 gpu::GpuChannelHost* GetGpuChannel(); |
41 int GetGpuChannelId() { return gpu_client_id_; } | 41 int GetGpuChannelId() { return gpu_client_id_; } |
42 | 42 |
| 43 // Closes the channel to the GPU process. This should be called before the IO |
| 44 // thread stops. |
| 45 void CloseChannel(); |
| 46 |
43 // Used to skip GpuChannelHost tests when there can be no GPU process. | 47 // Used to skip GpuChannelHost tests when there can be no GPU process. |
44 static bool CanUseForTesting(); | 48 static bool CanUseForTesting(); |
45 | 49 |
46 // Overridden from gpu::GpuChannelEstablishFactory: | 50 // Overridden from gpu::GpuChannelEstablishFactory: |
47 // The factory will return a null GpuChannelHost in the callback during | 51 // The factory will return a null GpuChannelHost in the callback during |
48 // shutdown. | 52 // shutdown. |
49 void EstablishGpuChannel( | 53 void EstablishGpuChannel( |
50 const gpu::GpuChannelEstablishedCallback& callback) override; | 54 const gpu::GpuChannelEstablishedCallback& callback) override; |
51 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; | 55 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; |
52 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 56 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
(...skipping 22 matching lines...) Expand all Loading... |
75 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; | 79 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; |
76 | 80 |
77 static BrowserGpuChannelHostFactory* instance_; | 81 static BrowserGpuChannelHostFactory* instance_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 83 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace content | 86 } // namespace content |
83 | 87 |
84 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 88 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
OLD | NEW |