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_GPU_GPU_CHILD_THREAD_H_ | 5 #ifndef CONTENT_GPU_GPU_CHILD_THREAD_H_ |
6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_ | 6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 typedef std::queue<IPC::Message*> DeferredMessages; | 57 typedef std::queue<IPC::Message*> DeferredMessages; |
58 | 58 |
59 // Returns the one gpu thread for this process. Note that this can only | 59 // Returns the one gpu thread for this process. Note that this can only |
60 // be accessed when running on the gpu thread itself. | 60 // be accessed when running on the gpu thread itself. |
61 static GpuChildThread* current(); | 61 static GpuChildThread* current(); |
62 | 62 |
63 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, | 63 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, |
64 bool dead_on_arrival, | 64 bool dead_on_arrival, |
65 const gpu::GPUInfo& gpu_info, | 65 const gpu::GPUInfo& gpu_info, |
66 const DeferredMessages& deferred_messages, | 66 const DeferredMessages& deferred_messages, |
67 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory, | 67 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
68 gpu::SyncPointManager* sync_point_manager); | |
69 | 68 |
70 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, | 69 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, |
71 const InProcessChildThreadParams& params, | 70 const InProcessChildThreadParams& params, |
72 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory, | 71 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
73 gpu::SyncPointManager* sync_point_manager); | |
74 | 72 |
75 ~GpuChildThread() override; | 73 ~GpuChildThread() override; |
76 | 74 |
77 void Shutdown() override; | 75 void Shutdown() override; |
78 | 76 |
79 void Init(const base::Time& process_start_time); | 77 void Init(const base::Time& process_start_time); |
80 void StopWatchdog(); | 78 void StopWatchdog(); |
81 | 79 |
82 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; } | 80 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; } |
83 | 81 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 // OnInitialize message, in which case we just declare ourselves DOA. | 153 // OnInitialize message, in which case we just declare ourselves DOA. |
156 bool dead_on_arrival_; | 154 bool dead_on_arrival_; |
157 base::Time process_start_time_; | 155 base::Time process_start_time_; |
158 scoped_refptr<GpuWatchdogThread> watchdog_thread_; | 156 scoped_refptr<GpuWatchdogThread> watchdog_thread_; |
159 | 157 |
160 #if defined(OS_WIN) | 158 #if defined(OS_WIN) |
161 // Windows specific client sandbox interface. | 159 // Windows specific client sandbox interface. |
162 sandbox::TargetServices* target_services_; | 160 sandbox::TargetServices* target_services_; |
163 #endif | 161 #endif |
164 | 162 |
165 // Non-owning. | 163 // Can be null if overridden by ContentGpuClient. |
piman
2016/04/22 00:50:43
nit: it can't be null - if ContentGpuClient doesn'
boliu
2016/04/22 01:08:36
It's the opposite case. If ContentGpuClient provid
piman
2016/04/22 04:05:08
Oh, I see - I misread the implementation because s
boliu
2016/04/22 04:41:15
Done. Also added a comment in .cc that manager fro
| |
166 gpu::SyncPointManager* sync_point_manager_; | 164 std::unique_ptr<gpu::SyncPointManager> sync_point_manager_; |
167 | 165 |
168 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; | 166 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; |
169 | 167 |
170 std::unique_ptr<MediaService> media_service_; | 168 std::unique_ptr<MediaService> media_service_; |
171 | 169 |
172 // Information about the GPU, such as device and vendor ID. | 170 // Information about the GPU, such as device and vendor ID. |
173 gpu::GPUInfo gpu_info_; | 171 gpu::GPUInfo gpu_info_; |
174 | 172 |
175 // Error messages collected in gpu_main() before the thread is created. | 173 // Error messages collected in gpu_main() before the thread is created. |
176 DeferredMessages deferred_messages_; | 174 DeferredMessages deferred_messages_; |
177 | 175 |
178 // Whether the GPU thread is running in the browser process. | 176 // Whether the GPU thread is running in the browser process. |
179 bool in_browser_process_; | 177 bool in_browser_process_; |
180 | 178 |
181 // The gpu::GpuMemoryBufferFactory instance used to allocate GpuMemoryBuffers. | 179 // The gpu::GpuMemoryBufferFactory instance used to allocate GpuMemoryBuffers. |
182 gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 180 gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
183 | 181 |
184 // Process control for Mojo application hosting. | 182 // Process control for Mojo application hosting. |
185 std::unique_ptr<GpuProcessControlImpl> process_control_; | 183 std::unique_ptr<GpuProcessControlImpl> process_control_; |
186 | 184 |
187 // Bindings to the mojom::ProcessControl impl. | 185 // Bindings to the mojom::ProcessControl impl. |
188 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; | 186 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; |
189 | 187 |
190 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); | 188 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); |
191 }; | 189 }; |
192 | 190 |
193 } // namespace content | 191 } // namespace content |
194 | 192 |
195 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ | 193 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ |
OLD | NEW |