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 | 33 |
34 // Overridden from gpu::GpuChannelHostFactory: | 34 // Overridden from gpu::GpuChannelHostFactory: |
35 bool IsMainThread() override; | 35 bool IsMainThread() override; |
36 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 36 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
37 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 37 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
38 size_t size) override; | 38 size_t size) override; |
39 | 39 |
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 | |
47 // Overridden from gpu::GpuChannelEstablishFactory: | 43 // Overridden from gpu::GpuChannelEstablishFactory: |
48 // The factory will return a null GpuChannelHost in the callback during | 44 // The factory will return a null GpuChannelHost in the callback during |
49 // shutdown. | 45 // shutdown. |
50 void EstablishGpuChannel( | 46 void EstablishGpuChannel( |
51 const gpu::GpuChannelEstablishedCallback& callback) override; | 47 const gpu::GpuChannelEstablishedCallback& callback) override; |
52 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; | 48 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; |
53 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 49 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
54 | 50 |
55 private: | 51 private: |
56 struct CreateRequest; | 52 struct CreateRequest; |
(...skipping 16 matching lines...) Expand all Loading... |
73 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; | 69 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; |
74 | 70 |
75 static BrowserGpuChannelHostFactory* instance_; | 71 static BrowserGpuChannelHostFactory* instance_; |
76 | 72 |
77 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 73 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
78 }; | 74 }; |
79 | 75 |
80 } // namespace content | 76 } // namespace content |
81 | 77 |
82 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 78 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
OLD | NEW |