| 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 <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "content/child/child_thread_impl.h" | 17 #include "content/child/child_thread_impl.h" |
| 18 #include "content/common/gpu/gpu_channel.h" | 18 #include "content/common/gpu/gpu_channel.h" |
| 19 #include "content/common/gpu/gpu_channel_manager.h" | 19 #include "content/common/gpu/gpu_channel_manager.h" |
| 20 #include "content/common/gpu/gpu_config.h" | 20 #include "content/common/gpu/gpu_config.h" |
| 21 #include "content/common/gpu/x_util.h" | 21 #include "content/common/gpu/x_util.h" |
| 22 #include "gpu/config/gpu_info.h" | 22 #include "gpu/config/gpu_info.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
| 24 | 24 |
| 25 namespace sandbox { | 25 namespace sandbox { |
| 26 class TargetServices; | 26 class TargetServices; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 class GpuMemoryBufferFactory; |
| 30 class GpuWatchdogThread; | 31 class GpuWatchdogThread; |
| 31 | 32 |
| 32 // The main thread of the GPU child process. There will only ever be one of | 33 // The main thread of the GPU child process. There will only ever be one of |
| 33 // these per process. It does process initialization and shutdown. It forwards | 34 // these per process. It does process initialization and shutdown. It forwards |
| 34 // IPC messages to GpuChannelManager, which is responsible for issuing rendering | 35 // IPC messages to GpuChannelManager, which is responsible for issuing rendering |
| 35 // commands to the GPU. | 36 // commands to the GPU. |
| 36 class GpuChildThread : public ChildThreadImpl { | 37 class GpuChildThread : public ChildThreadImpl { |
| 37 public: | 38 public: |
| 38 typedef std::queue<IPC::Message*> DeferredMessages; | 39 typedef std::queue<IPC::Message*> DeferredMessages; |
| 39 | 40 |
| 40 explicit GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, | 41 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, |
| 41 bool dead_on_arrival, | 42 bool dead_on_arrival, |
| 42 const gpu::GPUInfo& gpu_info, | 43 const gpu::GPUInfo& gpu_info, |
| 43 const DeferredMessages& deferred_messages); | 44 const DeferredMessages& deferred_messages, |
| 45 GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
| 44 | 46 |
| 45 explicit GpuChildThread(const InProcessChildThreadParams& params); | 47 explicit GpuChildThread(const InProcessChildThreadParams& params); |
| 46 | 48 |
| 47 ~GpuChildThread() override; | 49 ~GpuChildThread() override; |
| 48 | 50 |
| 49 void Shutdown() override; | 51 void Shutdown() override; |
| 50 | 52 |
| 51 void Init(const base::Time& process_start_time); | 53 void Init(const base::Time& process_start_time); |
| 52 void StopWatchdog(); | 54 void StopWatchdog(); |
| 53 | 55 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 89 |
| 88 // Information about the GPU, such as device and vendor ID. | 90 // Information about the GPU, such as device and vendor ID. |
| 89 gpu::GPUInfo gpu_info_; | 91 gpu::GPUInfo gpu_info_; |
| 90 | 92 |
| 91 // Error messages collected in gpu_main() before the thread is created. | 93 // Error messages collected in gpu_main() before the thread is created. |
| 92 DeferredMessages deferred_messages_; | 94 DeferredMessages deferred_messages_; |
| 93 | 95 |
| 94 // Whether the GPU thread is running in the browser process. | 96 // Whether the GPU thread is running in the browser process. |
| 95 bool in_browser_process_; | 97 bool in_browser_process_; |
| 96 | 98 |
| 99 // The GpuMemoryBufferFactory instance used to allocate GpuMemoryBuffers. |
| 100 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 101 |
| 97 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); | 102 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 } // namespace content | 105 } // namespace content |
| 101 | 106 |
| 102 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ | 107 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ |
| OLD | NEW |