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_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "content/common/child_process.h" | 16 #include "content/common/child_process.h" |
17 #include "content/common/child_thread.h" | 17 #include "content/common/child_thread.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/common/gpu/client/gpu_channel_host.h" | 19 #include "content/common/gpu/client/gpu_channel_host.h" |
20 #include "content/common/gpu/gpu_process_launch_causes.h" | 20 #include "content/common/gpu/gpu_process_launch_causes.h" |
21 #include "content/public/renderer/render_thread.h" | 21 #include "content/public/renderer/render_thread.h" |
22 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
23 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
24 | 24 |
| 25 class GrContext; |
25 class SkBitmap; | 26 class SkBitmap; |
26 struct ViewMsg_New_Params; | 27 struct ViewMsg_New_Params; |
27 | 28 |
28 namespace WebKit { | 29 namespace WebKit { |
| 30 class WebGraphicsContext3D; |
29 class WebMediaStreamCenter; | 31 class WebMediaStreamCenter; |
30 class WebMediaStreamCenterClient; | 32 class WebMediaStreamCenterClient; |
31 } | 33 } |
32 | 34 |
33 namespace base { | 35 namespace base { |
34 class MessageLoopProxy; | 36 class MessageLoopProxy; |
35 class Thread; | 37 class Thread; |
36 | 38 |
37 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
38 namespace win { | 40 namespace win { |
39 class ScopedCOMInitializer; | 41 class ScopedCOMInitializer; |
40 } | 42 } |
41 #endif | 43 #endif |
42 } | 44 } |
43 | 45 |
| 46 namespace cc { |
| 47 class ContextProvider; |
| 48 } |
| 49 |
44 namespace IPC { | 50 namespace IPC { |
45 class ForwardingMessageFilter; | 51 class ForwardingMessageFilter; |
46 } | 52 } |
47 | 53 |
48 namespace media { | 54 namespace media { |
49 class AudioHardwareConfig; | 55 class AudioHardwareConfig; |
50 } | 56 } |
51 | 57 |
52 namespace v8 { | 58 namespace v8 { |
53 class Extension; | 59 class Extension; |
54 } | 60 } |
55 | 61 |
| 62 namespace webkit { |
| 63 namespace gpu { |
| 64 class GrContextForWebGraphicsContext3D; |
| 65 } |
| 66 } |
| 67 |
56 namespace content { | 68 namespace content { |
57 | 69 |
58 class AppCacheDispatcher; | 70 class AppCacheDispatcher; |
59 class AudioInputMessageFilter; | 71 class AudioInputMessageFilter; |
60 class AudioMessageFilter; | 72 class AudioMessageFilter; |
61 class AudioRendererMixerManager; | 73 class AudioRendererMixerManager; |
62 class CompositorThread; | 74 class CompositorThread; |
63 class DBMessageFilter; | 75 class DBMessageFilter; |
64 class DevToolsAgentFilter; | 76 class DevToolsAgentFilter; |
65 class DomStorageDispatcher; | 77 class DomStorageDispatcher; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 221 |
210 AudioInputMessageFilter* audio_input_message_filter() { | 222 AudioInputMessageFilter* audio_input_message_filter() { |
211 return audio_input_message_filter_.get(); | 223 return audio_input_message_filter_.get(); |
212 } | 224 } |
213 | 225 |
214 AudioMessageFilter* audio_message_filter() { | 226 AudioMessageFilter* audio_message_filter() { |
215 return audio_message_filter_.get(); | 227 return audio_message_filter_.get(); |
216 } | 228 } |
217 | 229 |
218 | 230 |
219 | |
220 // Creates the embedder implementation of WebMediaStreamCenter. | 231 // Creates the embedder implementation of WebMediaStreamCenter. |
221 // The resulting object is owned by WebKit and deleted by WebKit at tear-down. | 232 // The resulting object is owned by WebKit and deleted by WebKit at tear-down. |
222 WebKit::WebMediaStreamCenter* CreateMediaStreamCenter( | 233 WebKit::WebMediaStreamCenter* CreateMediaStreamCenter( |
223 WebKit::WebMediaStreamCenterClient* client); | 234 WebKit::WebMediaStreamCenterClient* client); |
224 | 235 |
225 // Returns a factory used for creating RTC PeerConnection objects. | 236 // Returns a factory used for creating RTC PeerConnection objects. |
226 MediaStreamDependencyFactory* GetMediaStreamDependencyFactory(); | 237 MediaStreamDependencyFactory* GetMediaStreamDependencyFactory(); |
227 | 238 |
228 PeerConnectionTracker* peer_connection_tracker() { | 239 PeerConnectionTracker* peer_connection_tracker() { |
229 return peer_connection_tracker_.get(); | 240 return peer_connection_tracker_.get(); |
(...skipping 25 matching lines...) Expand all Loading... |
255 // Returns a graphics context shared among all | 266 // Returns a graphics context shared among all |
256 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned | 267 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned |
257 // by this class and must be null-tested before each use to detect context | 268 // by this class and must be null-tested before each use to detect context |
258 // loss. The returned context is only valid on the compositor thread when | 269 // loss. The returned context is only valid on the compositor thread when |
259 // threaded compositing is enabled. | 270 // threaded compositing is enabled. |
260 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D(); | 271 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D(); |
261 | 272 |
262 // Handle loss of the shared GpuVDAContext3D context above. | 273 // Handle loss of the shared GpuVDAContext3D context above. |
263 static void OnGpuVDAContextLoss(); | 274 static void OnGpuVDAContextLoss(); |
264 | 275 |
| 276 scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread(); |
| 277 scoped_refptr<cc::ContextProvider> |
| 278 OffscreenContextProviderForCompositorThread(); |
| 279 |
265 // AudioRendererMixerManager instance which manages renderer side mixer | 280 // AudioRendererMixerManager instance which manages renderer side mixer |
266 // instances shared based on configured audio parameters. Lazily created on | 281 // instances shared based on configured audio parameters. Lazily created on |
267 // first call. | 282 // first call. |
268 AudioRendererMixerManager* GetAudioRendererMixerManager(); | 283 AudioRendererMixerManager* GetAudioRendererMixerManager(); |
269 | 284 |
270 // AudioHardwareConfig contains audio hardware configuration for | 285 // AudioHardwareConfig contains audio hardware configuration for |
271 // renderer side clients. Creation requires a synchronous IPC call so it is | 286 // renderer side clients. Creation requires a synchronous IPC call so it is |
272 // lazily created on the first call. | 287 // lazily created on the first call. |
273 media::AudioHardwareConfig* GetAudioHardwareConfig(); | 288 media::AudioHardwareConfig* GetAudioHardwareConfig(); |
274 | 289 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void OnSetZoomLevelForCurrentURL(const std::string& host, double zoom_level); | 348 void OnSetZoomLevelForCurrentURL(const std::string& host, double zoom_level); |
334 void OnCreateNewView(const ViewMsg_New_Params& params); | 349 void OnCreateNewView(const ViewMsg_New_Params& params); |
335 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 350 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
336 void OnPurgePluginListCache(bool reload_pages); | 351 void OnPurgePluginListCache(bool reload_pages); |
337 void OnNetworkStateChanged(bool online); | 352 void OnNetworkStateChanged(bool online); |
338 void OnGetAccessibilityTree(); | 353 void OnGetAccessibilityTree(); |
339 void OnTempCrashWithData(const GURL& data); | 354 void OnTempCrashWithData(const GURL& data); |
340 | 355 |
341 void IdleHandlerInForegroundTab(); | 356 void IdleHandlerInForegroundTab(); |
342 | 357 |
| 358 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); |
| 359 |
343 // These objects live solely on the render thread. | 360 // These objects live solely on the render thread. |
344 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 361 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
345 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_; | 362 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_; |
346 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_; | 363 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_; |
347 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; | 364 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; |
348 | 365 |
349 // Used on the render thread and deleted by WebKit at shutdown. | 366 // Used on the render thread and deleted by WebKit at shutdown. |
350 WebKit::WebMediaStreamCenter* media_stream_center_; | 367 WebKit::WebMediaStreamCenter* media_stream_center_; |
351 | 368 |
352 // Used on the renderer and IPC threads. | 369 // Used on the renderer and IPC threads. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 // The channel from the renderer process to the GPU process. | 417 // The channel from the renderer process to the GPU process. |
401 scoped_refptr<GpuChannelHost> gpu_channel_; | 418 scoped_refptr<GpuChannelHost> gpu_channel_; |
402 | 419 |
403 // A lazily initiated thread on which file operations are run. | 420 // A lazily initiated thread on which file operations are run. |
404 scoped_ptr<base::Thread> file_thread_; | 421 scoped_ptr<base::Thread> file_thread_; |
405 | 422 |
406 bool compositor_initialized_; | 423 bool compositor_initialized_; |
407 scoped_ptr<CompositorThread> compositor_thread_; | 424 scoped_ptr<CompositorThread> compositor_thread_; |
408 scoped_refptr<IPC::ForwardingMessageFilter> compositor_output_surface_filter_; | 425 scoped_refptr<IPC::ForwardingMessageFilter> compositor_output_surface_filter_; |
409 | 426 |
| 427 class RendererContextProviderCommandBuffer; |
| 428 scoped_refptr<RendererContextProviderCommandBuffer> |
| 429 shared_contexts_main_thread_; |
| 430 scoped_refptr<RendererContextProviderCommandBuffer> |
| 431 shared_contexts_compositor_thread_; |
| 432 |
410 ObserverList<RenderProcessObserver> observers_; | 433 ObserverList<RenderProcessObserver> observers_; |
411 | 434 |
412 class GpuVDAContextLostCallback; | 435 class GpuVDAContextLostCallback; |
413 scoped_ptr<GpuVDAContextLostCallback> context_lost_cb_; | 436 scoped_ptr<GpuVDAContextLostCallback> context_lost_cb_; |
414 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_; | 437 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_; |
415 | 438 |
416 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; | 439 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; |
417 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; | 440 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; |
418 | 441 |
419 HistogramCustomizer histogram_customizer_; | 442 HistogramCustomizer histogram_customizer_; |
420 | 443 |
421 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 444 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
422 }; | 445 }; |
423 | 446 |
424 } // namespace content | 447 } // namespace content |
425 | 448 |
426 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 449 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |