| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_MUS_COMMON_GPU_SERVICE_H_ | 5 #ifndef COMPONENTS_MUS_COMMON_GPU_SERVICE_H_ |
| 6 #define COMPONENTS_MUS_COMMON_GPU_SERVICE_H_ | 6 #define COMPONENTS_MUS_COMMON_GPU_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 12 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 13 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 15 #include "components/mus/common/mus_common_export.h" | 17 #include "components/mus/common/mus_common_export.h" |
| 16 #include "gpu/ipc/client/gpu_channel_host.h" | 18 #include "gpu/ipc/client/gpu_channel_host.h" |
| 17 | 19 |
| 18 namespace shell { | 20 namespace shell { |
| 19 class Connector; | 21 class Connector; |
| 20 } | 22 } |
| 21 | 23 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 GpuService(); | 39 GpuService(); |
| 38 ~GpuService() override; | 40 ~GpuService() override; |
| 39 | 41 |
| 40 // gpu::GpuChannelHostFactory overrides: | 42 // gpu::GpuChannelHostFactory overrides: |
| 41 bool IsMainThread() override; | 43 bool IsMainThread() override; |
| 42 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 44 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| 43 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 45 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| 44 size_t size) override; | 46 size_t size) override; |
| 45 | 47 |
| 46 base::MessageLoop* main_message_loop_; | 48 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 47 base::WaitableEvent shutdown_event_; | 49 base::WaitableEvent shutdown_event_; |
| 48 base::Thread io_thread_; | 50 base::Thread io_thread_; |
| 49 std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 51 std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 50 | 52 |
| 51 // Lock for |gpu_channel_|. | 53 // Lock for |gpu_channel_|. |
| 52 base::Lock lock_; | 54 base::Lock lock_; |
| 53 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; | 55 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
| 54 | 56 |
| 55 DISALLOW_COPY_AND_ASSIGN(GpuService); | 57 DISALLOW_COPY_AND_ASSIGN(GpuService); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace mus | 60 } // namespace mus |
| 59 | 61 |
| 60 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_CONNECTION_H_ | 62 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_CONNECTION_H_ |
| OLD | NEW |