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 14 matching lines...) Expand all Loading... |
25 #include "gpu/ipc/service/gpu_channel_manager.h" | 25 #include "gpu/ipc/service/gpu_channel_manager.h" |
26 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" | 26 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" |
27 #include "gpu/ipc/service/gpu_config.h" | 27 #include "gpu/ipc/service/gpu_config.h" |
28 #include "gpu/ipc/service/x_util.h" | 28 #include "gpu/ipc/service/x_util.h" |
29 #include "mojo/public/cpp/bindings/binding_set.h" | 29 #include "mojo/public/cpp/bindings/binding_set.h" |
30 #include "services/shell/public/interfaces/service_factory.mojom.h" | 30 #include "services/shell/public/interfaces/service_factory.mojom.h" |
31 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
32 | 32 |
33 namespace gpu { | 33 namespace gpu { |
34 class GpuMemoryBufferFactory; | 34 class GpuMemoryBufferFactory; |
| 35 class GpuWatchdogThread; |
35 class SyncPointManager; | 36 class SyncPointManager; |
36 } | 37 } |
37 | 38 |
38 namespace media { | 39 namespace media { |
39 class MediaService; | 40 class MediaService; |
40 } | 41 } |
41 | 42 |
42 namespace sandbox { | 43 namespace sandbox { |
43 class TargetServices; | 44 class TargetServices; |
44 } | 45 } |
45 | 46 |
46 namespace content { | 47 namespace content { |
47 class GpuServiceFactory; | 48 class GpuServiceFactory; |
48 class GpuWatchdogThread; | |
49 struct EstablishChannelParams; | 49 struct EstablishChannelParams; |
50 | 50 |
51 // The main thread of the GPU child process. There will only ever be one of | 51 // The main thread of the GPU child process. There will only ever be one of |
52 // these per process. It does process initialization and shutdown. It forwards | 52 // these per process. It does process initialization and shutdown. It forwards |
53 // IPC messages to gpu::GpuChannelManager, which is responsible for issuing | 53 // IPC messages to gpu::GpuChannelManager, which is responsible for issuing |
54 // rendering commands to the GPU. | 54 // rendering commands to the GPU. |
55 class GpuChildThread : public ChildThreadImpl, | 55 class GpuChildThread : public ChildThreadImpl, |
56 public gpu::GpuChannelManagerDelegate, | 56 public gpu::GpuChannelManagerDelegate, |
57 public base::FieldTrialList::Observer { | 57 public base::FieldTrialList::Observer { |
58 public: | 58 public: |
59 typedef std::queue<IPC::Message*> DeferredMessages; | 59 typedef std::queue<IPC::Message*> DeferredMessages; |
60 | 60 |
61 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, | 61 GpuChildThread(gpu::GpuWatchdogThread* gpu_watchdog_thread, |
62 bool dead_on_arrival, | 62 bool dead_on_arrival, |
63 const gpu::GPUInfo& gpu_info, | 63 const gpu::GPUInfo& gpu_info, |
64 const DeferredMessages& deferred_messages, | 64 const DeferredMessages& deferred_messages, |
65 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); | 65 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
66 | 66 |
67 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, | 67 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, |
68 const InProcessChildThreadParams& params, | 68 const InProcessChildThreadParams& params, |
69 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); | 69 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
70 | 70 |
71 ~GpuChildThread() override; | 71 ~GpuChildThread() override; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void OnLoseAllContexts(); | 131 void OnLoseAllContexts(); |
132 | 132 |
133 void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request); | 133 void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request); |
134 | 134 |
135 gpu::GpuPreferences gpu_preferences_; | 135 gpu::GpuPreferences gpu_preferences_; |
136 | 136 |
137 // Set this flag to true if a fatal error occurred before we receive the | 137 // Set this flag to true if a fatal error occurred before we receive the |
138 // OnInitialize message, in which case we just declare ourselves DOA. | 138 // OnInitialize message, in which case we just declare ourselves DOA. |
139 bool dead_on_arrival_; | 139 bool dead_on_arrival_; |
140 base::Time process_start_time_; | 140 base::Time process_start_time_; |
141 scoped_refptr<GpuWatchdogThread> watchdog_thread_; | 141 scoped_refptr<gpu::GpuWatchdogThread> watchdog_thread_; |
142 | 142 |
143 #if defined(OS_WIN) | 143 #if defined(OS_WIN) |
144 // Windows specific client sandbox interface. | 144 // Windows specific client sandbox interface. |
145 sandbox::TargetServices* target_services_; | 145 sandbox::TargetServices* target_services_; |
146 #endif | 146 #endif |
147 | 147 |
148 // Can be null if overridden by ContentGpuClient. | 148 // Can be null if overridden by ContentGpuClient. |
149 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; | 149 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; |
150 | 150 |
151 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; | 151 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; |
(...skipping 17 matching lines...) Expand all Loading... |
169 | 169 |
170 // Bindings to the shell::mojom::ServiceFactory impl. | 170 // Bindings to the shell::mojom::ServiceFactory impl. |
171 mojo::BindingSet<shell::mojom::ServiceFactory> service_factory_bindings_; | 171 mojo::BindingSet<shell::mojom::ServiceFactory> service_factory_bindings_; |
172 | 172 |
173 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); | 173 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); |
174 }; | 174 }; |
175 | 175 |
176 } // namespace content | 176 } // namespace content |
177 | 177 |
178 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ | 178 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ |
OLD | NEW |