[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 8707caa | 2013-09-04 16:41:30 | [diff] [blame] | 5 | #ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
6 | #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | ||||
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 7 | |
8 | #include "base/threading/thread.h" | ||||
9 | #include "content/common/content_export.h" | ||||
morrita | c6238ab | 2015-03-18 01:48:29 | [diff] [blame] | 10 | #include "content/common/in_process_child_thread_params.h" |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 11 | |
12 | namespace content { | ||||
13 | |||||
grt | 8c64842 | 2015-06-29 18:17:17 | [diff] [blame] | 14 | class GpuMemoryBufferFactory; |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 15 | class GpuProcess; |
16 | |||||
17 | // This class creates a GPU thread (instead of a GPU process), when running | ||||
18 | // with --in-process-gpu or --single-process. | ||||
[email protected] | 8707caa | 2013-09-04 16:41:30 | [diff] [blame] | 19 | class InProcessGpuThread : public base::Thread { |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 20 | public: |
morrita | c6238ab | 2015-03-18 01:48:29 | [diff] [blame] | 21 | InProcessGpuThread(const InProcessChildThreadParams& params); |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 22 | ~InProcessGpuThread() override; |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 23 | |
24 | protected: | ||||
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 25 | void Init() override; |
26 | void CleanUp() override; | ||||
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 27 | |
28 | private: | ||||
morrita | c6238ab | 2015-03-18 01:48:29 | [diff] [blame] | 29 | InProcessChildThreadParams params_; |
30 | |||||
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 31 | // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. |
32 | GpuProcess* gpu_process_; | ||||
33 | |||||
grt | 8c64842 | 2015-06-29 18:17:17 | [diff] [blame] | 34 | scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
35 | |||||
[email protected] | 8707caa | 2013-09-04 16:41:30 | [diff] [blame] | 36 | DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 37 | }; |
38 | |||||
[email protected] | 8707caa | 2013-09-04 16:41:30 | [diff] [blame] | 39 | CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( |
morrita | c6238ab | 2015-03-18 01:48:29 | [diff] [blame] | 40 | const InProcessChildThreadParams& params); |
[email protected] | d7a2d89 | 2013-08-16 07:45:36 | [diff] [blame] | 41 | |
42 | } // namespace content | ||||
43 | |||||
[email protected] | 8707caa | 2013-09-04 16:41:30 | [diff] [blame] | 44 | #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |