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 10 matching lines...) Expand all Loading... |
21 #include "content/child/child_thread_impl.h" | 21 #include "content/child/child_thread_impl.h" |
22 #include "content/common/process_control.mojom.h" | 22 #include "content/common/process_control.mojom.h" |
23 #include "gpu/command_buffer/service/gpu_preferences.h" | 23 #include "gpu/command_buffer/service/gpu_preferences.h" |
24 #include "gpu/config/gpu_info.h" | 24 #include "gpu/config/gpu_info.h" |
25 #include "gpu/ipc/service/gpu_channel.h" | 25 #include "gpu/ipc/service/gpu_channel.h" |
26 #include "gpu/ipc/service/gpu_channel_manager.h" | 26 #include "gpu/ipc/service/gpu_channel_manager.h" |
27 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" | 27 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" |
28 #include "gpu/ipc/service/gpu_config.h" | 28 #include "gpu/ipc/service/gpu_config.h" |
29 #include "gpu/ipc/service/x_util.h" | 29 #include "gpu/ipc/service/x_util.h" |
30 #include "mojo/public/cpp/bindings/binding_set.h" | 30 #include "mojo/public/cpp/bindings/binding_set.h" |
31 #include "mojo/public/cpp/bindings/interface_request.h" | |
32 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
33 | 32 |
34 namespace gpu { | 33 namespace gpu { |
35 class GpuMemoryBufferFactory; | 34 class GpuMemoryBufferFactory; |
36 class SyncPointManager; | 35 class SyncPointManager; |
37 } | 36 } |
38 | 37 |
39 namespace media { | 38 namespace media { |
40 class MediaService; | 39 class MediaService; |
41 } | 40 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void Init(const base::Time& process_start_time); | 79 void Init(const base::Time& process_start_time); |
81 void StopWatchdog(); | 80 void StopWatchdog(); |
82 | 81 |
83 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; } | 82 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; } |
84 | 83 |
85 private: | 84 private: |
86 // ChildThreadImpl:. | 85 // ChildThreadImpl:. |
87 bool Send(IPC::Message* msg) override; | 86 bool Send(IPC::Message* msg) override; |
88 bool OnControlMessageReceived(const IPC::Message& msg) override; | 87 bool OnControlMessageReceived(const IPC::Message& msg) override; |
89 bool OnMessageReceived(const IPC::Message& msg) override; | 88 bool OnMessageReceived(const IPC::Message& msg) override; |
90 bool OnConnect(shell::Connection* connection) override; | |
91 shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; | |
92 shell::InterfaceProvider* GetInterfaceProviderForConnection() override; | |
93 | 89 |
94 // gpu::GpuChannelManagerDelegate: | 90 // gpu::GpuChannelManagerDelegate: |
95 void SetActiveURL(const GURL& url) override; | 91 void SetActiveURL(const GURL& url) override; |
96 void DidCreateOffscreenContext(const GURL& active_url) override; | 92 void DidCreateOffscreenContext(const GURL& active_url) override; |
97 void DidDestroyChannel(int client_id) override; | 93 void DidDestroyChannel(int client_id) override; |
98 void DidDestroyOffscreenContext(const GURL& active_url) override; | 94 void DidDestroyOffscreenContext(const GURL& active_url) override; |
99 void DidLoseContext(bool offscreen, | 95 void DidLoseContext(bool offscreen, |
100 gpu::error::ContextLostReason reason, | 96 gpu::error::ContextLostReason reason, |
101 const GURL& active_url) override; | 97 const GURL& active_url) override; |
102 void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override; | 98 void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override; |
(...skipping 28 matching lines...) Expand all Loading... |
131 void OnLoadedShader(const std::string& shader); | 127 void OnLoadedShader(const std::string& shader); |
132 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 128 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
133 int client_id, | 129 int client_id, |
134 const gpu::SyncToken& sync_token); | 130 const gpu::SyncToken& sync_token); |
135 #if defined(OS_ANDROID) | 131 #if defined(OS_ANDROID) |
136 void OnWakeUpGpu(); | 132 void OnWakeUpGpu(); |
137 void OnDestroyingVideoSurface(int surface_id); | 133 void OnDestroyingVideoSurface(int surface_id); |
138 #endif | 134 #endif |
139 void OnLoseAllContexts(); | 135 void OnLoseAllContexts(); |
140 | 136 |
141 void BindProcessControlRequest( | 137 void BindProcessControlRequest(mojom::ProcessControlRequest request); |
142 mojo::InterfaceRequest<mojom::ProcessControl> request); | |
143 | 138 |
144 gpu::GpuPreferences gpu_preferences_; | 139 gpu::GpuPreferences gpu_preferences_; |
145 | 140 |
146 // Set this flag to true if a fatal error occurred before we receive the | 141 // Set this flag to true if a fatal error occurred before we receive the |
147 // OnInitialize message, in which case we just declare ourselves DOA. | 142 // OnInitialize message, in which case we just declare ourselves DOA. |
148 bool dead_on_arrival_; | 143 bool dead_on_arrival_; |
149 base::Time process_start_time_; | 144 base::Time process_start_time_; |
150 scoped_refptr<GpuWatchdogThread> watchdog_thread_; | 145 scoped_refptr<GpuWatchdogThread> watchdog_thread_; |
151 | 146 |
152 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
(...skipping 19 matching lines...) Expand all Loading... |
172 | 167 |
173 // The gpu::GpuMemoryBufferFactory instance used to allocate GpuMemoryBuffers. | 168 // The gpu::GpuMemoryBufferFactory instance used to allocate GpuMemoryBuffers. |
174 gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 169 gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
175 | 170 |
176 // Process control for Mojo application hosting. | 171 // Process control for Mojo application hosting. |
177 std::unique_ptr<GpuProcessControlImpl> process_control_; | 172 std::unique_ptr<GpuProcessControlImpl> process_control_; |
178 | 173 |
179 // Bindings to the mojom::ProcessControl impl. | 174 // Bindings to the mojom::ProcessControl impl. |
180 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; | 175 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; |
181 | 176 |
182 base::Closure resume_interface_bindings_callback_; | |
183 | |
184 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); | 177 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); |
185 }; | 178 }; |
186 | 179 |
187 } // namespace content | 180 } // namespace content |
188 | 181 |
189 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ | 182 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ |
OLD | NEW |