| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GPU_IN_PROCESS_GPU_THREAD_H_ | 5 #ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| 6 #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 6 #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/content_export.h" |
| 10 #include "content/common/in_process_child_thread_params.h" | 11 #include "content/common/in_process_child_thread_params.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 14 class GpuMemoryBufferFactory; | |
| 15 class GpuProcess; | 15 class GpuProcess; |
| 16 | 16 |
| 17 // This class creates a GPU thread (instead of a GPU process), when running | 17 // This class creates a GPU thread (instead of a GPU process), when running |
| 18 // with --in-process-gpu or --single-process. | 18 // with --in-process-gpu or --single-process. |
| 19 class InProcessGpuThread : public base::Thread { | 19 class InProcessGpuThread : public base::Thread { |
| 20 public: | 20 public: |
| 21 InProcessGpuThread(const InProcessChildThreadParams& params); | 21 InProcessGpuThread(const InProcessChildThreadParams& params); |
| 22 ~InProcessGpuThread() override; | 22 ~InProcessGpuThread() override; |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 void Init() override; | 25 void Init() override; |
| 26 void CleanUp() override; | 26 void CleanUp() override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 InProcessChildThreadParams params_; | 29 InProcessChildThreadParams params_; |
| 30 | 30 |
| 31 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. | 31 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. |
| 32 GpuProcess* gpu_process_; | 32 GpuProcess* gpu_process_; |
| 33 | 33 |
| 34 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); | 34 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( | 37 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( |
| 40 const InProcessChildThreadParams& params); | 38 const InProcessChildThreadParams& params); |
| 41 | 39 |
| 42 } // namespace content | 40 } // namespace content |
| 43 | 41 |
| 44 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 42 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| OLD | NEW |