Chromium Code Reviews| Index: services/ui/public/cpp/gpu_service.h |
| diff --git a/services/ui/public/cpp/gpu_service.h b/services/ui/public/cpp/gpu_service.h |
| index a1155ae0bdc3745714270da2455db5d2c75720fc..f7af2a56e221545481eeccceb2dca6e30936faf8 100644 |
| --- a/services/ui/public/cpp/gpu_service.h |
| +++ b/services/ui/public/cpp/gpu_service.h |
| @@ -35,9 +35,14 @@ class GpuService : public gpu::GpuChannelHostFactory, |
| } |
| // The GpuService has to be initialized in the main thread before establishing |
| - // the gpu channel. |
| + // the gpu channel. The IO thread task-runner needed for the gpu channel can |
| + // be set using SetIOTaskRunner(). If no task-runner is set, then a new thread |
| + // is created for IO instead. |
| static std::unique_ptr<GpuService> Initialize(shell::Connector* connector); |
| + void SetIOThreadTaskRunner( |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
|
Fady Samuel
2016/08/18 11:00:56
Can this not be passed in Initialize to avoid givi
sadrul
2016/08/18 12:56:53
It's not straight forward, because for the chrome
Fady Samuel
2016/08/18 13:05:39
LGTM but I still feel like this is brittle because
|
| + |
| // gpu::GpuChannelEstablishFactory: |
| void EstablishGpuChannel( |
| const gpu::GpuChannelEstablishedCallback& callback) override; |
| @@ -65,9 +70,10 @@ class GpuService : public gpu::GpuChannelHostFactory, |
| size_t size) override; |
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| shell::Connector* connector_; |
| base::WaitableEvent shutdown_event_; |
| - base::Thread io_thread_; |
| + std::unique_ptr<base::Thread> io_thread_; |
| std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| // Lock for |gpu_channel_|, |establish_callbacks_| & |is_establishing_|. |