Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 12212100: Provide shared context to Platform API in renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 212
201 AudioInputMessageFilter* audio_input_message_filter() { 213 AudioInputMessageFilter* audio_input_message_filter() {
202 return audio_input_message_filter_.get(); 214 return audio_input_message_filter_.get();
203 } 215 }
204 216
205 AudioMessageFilter* audio_message_filter() { 217 AudioMessageFilter* audio_message_filter() {
206 return audio_message_filter_.get(); 218 return audio_message_filter_.get();
207 } 219 }
208 220
209 221
210
211 // Creates the embedder implementation of WebMediaStreamCenter. 222 // Creates the embedder implementation of WebMediaStreamCenter.
212 // The resulting object is owned by WebKit and deleted by WebKit at tear-down. 223 // The resulting object is owned by WebKit and deleted by WebKit at tear-down.
213 WebKit::WebMediaStreamCenter* CreateMediaStreamCenter( 224 WebKit::WebMediaStreamCenter* CreateMediaStreamCenter(
214 WebKit::WebMediaStreamCenterClient* client); 225 WebKit::WebMediaStreamCenterClient* client);
215 226
216 // Returns a factory used for creating RTC PeerConnection objects. 227 // Returns a factory used for creating RTC PeerConnection objects.
217 MediaStreamDependencyFactory* GetMediaStreamDependencyFactory(); 228 MediaStreamDependencyFactory* GetMediaStreamDependencyFactory();
218 229
219 PeerConnectionTracker* peer_connection_tracker() { 230 PeerConnectionTracker* peer_connection_tracker() {
220 return peer_connection_tracker_.get(); 231 return peer_connection_tracker_.get();
(...skipping 25 matching lines...) Expand all
246 // Returns a graphics context shared among all 257 // Returns a graphics context shared among all
247 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned 258 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned
248 // by this class and must be null-tested before each use to detect context 259 // by this class and must be null-tested before each use to detect context
249 // loss. The returned context is only valid on the compositor thread when 260 // loss. The returned context is only valid on the compositor thread when
250 // threaded compositing is enabled. 261 // threaded compositing is enabled.
251 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D(); 262 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D();
252 263
253 // Handle loss of the shared GpuVDAContext3D context above. 264 // Handle loss of the shared GpuVDAContext3D context above.
254 static void OnGpuVDAContextLoss(); 265 static void OnGpuVDAContextLoss();
255 266
267 scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread();
268 scoped_refptr<cc::ContextProvider>
269 OffscreenContextProviderForCompositorThread();
270
256 // AudioRendererMixerManager instance which manages renderer side mixer 271 // AudioRendererMixerManager instance which manages renderer side mixer
257 // instances shared based on configured audio parameters. Lazily created on 272 // instances shared based on configured audio parameters. Lazily created on
258 // first call. 273 // first call.
259 AudioRendererMixerManager* GetAudioRendererMixerManager(); 274 AudioRendererMixerManager* GetAudioRendererMixerManager();
260 275
261 // AudioHardwareConfig contains audio hardware configuration for 276 // AudioHardwareConfig contains audio hardware configuration for
262 // renderer side clients. Creation requires a synchronous IPC call so it is 277 // renderer side clients. Creation requires a synchronous IPC call so it is
263 // lazily created on the first call. 278 // lazily created on the first call.
264 media::AudioHardwareConfig* GetAudioHardwareConfig(); 279 media::AudioHardwareConfig* GetAudioHardwareConfig();
265 280
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 void OnSetZoomLevelForCurrentURL(const std::string& host, double zoom_level); 339 void OnSetZoomLevelForCurrentURL(const std::string& host, double zoom_level);
325 void OnCreateNewView(const ViewMsg_New_Params& params); 340 void OnCreateNewView(const ViewMsg_New_Params& params);
326 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); 341 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
327 void OnPurgePluginListCache(bool reload_pages); 342 void OnPurgePluginListCache(bool reload_pages);
328 void OnNetworkStateChanged(bool online); 343 void OnNetworkStateChanged(bool online);
329 void OnGetAccessibilityTree(); 344 void OnGetAccessibilityTree();
330 void OnTempCrashWithData(const GURL& data); 345 void OnTempCrashWithData(const GURL& data);
331 346
332 void IdleHandlerInForegroundTab(); 347 void IdleHandlerInForegroundTab();
333 348
349 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d();
350
334 // These objects live solely on the render thread. 351 // These objects live solely on the render thread.
335 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; 352 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
336 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_; 353 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_;
337 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_; 354 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_;
338 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; 355 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_;
339 356
340 // Used on the render thread and deleted by WebKit at shutdown. 357 // Used on the render thread and deleted by WebKit at shutdown.
341 WebKit::WebMediaStreamCenter* media_stream_center_; 358 WebKit::WebMediaStreamCenter* media_stream_center_;
342 359
343 // Used on the renderer and IPC threads. 360 // Used on the renderer and IPC threads.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // The channel from the renderer process to the GPU process. 406 // The channel from the renderer process to the GPU process.
390 scoped_refptr<GpuChannelHost> gpu_channel_; 407 scoped_refptr<GpuChannelHost> gpu_channel_;
391 408
392 // A lazily initiated thread on which file operations are run. 409 // A lazily initiated thread on which file operations are run.
393 scoped_ptr<base::Thread> file_thread_; 410 scoped_ptr<base::Thread> file_thread_;
394 411
395 bool compositor_initialized_; 412 bool compositor_initialized_;
396 scoped_ptr<CompositorThread> compositor_thread_; 413 scoped_ptr<CompositorThread> compositor_thread_;
397 scoped_refptr<IPC::ForwardingMessageFilter> compositor_output_surface_filter_; 414 scoped_refptr<IPC::ForwardingMessageFilter> compositor_output_surface_filter_;
398 415
416 class RendererContextProviderCommandBuffer;
417 scoped_refptr<RendererContextProviderCommandBuffer>
418 shared_contexts_main_thread_;
419 scoped_refptr<RendererContextProviderCommandBuffer>
420 shared_contexts_compositor_thread_;
421
399 ObserverList<RenderProcessObserver> observers_; 422 ObserverList<RenderProcessObserver> observers_;
400 423
401 class GpuVDAContextLostCallback; 424 class GpuVDAContextLostCallback;
402 scoped_ptr<GpuVDAContextLostCallback> context_lost_cb_; 425 scoped_ptr<GpuVDAContextLostCallback> context_lost_cb_;
403 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_; 426 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_;
404 427
405 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; 428 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_;
406 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; 429 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_;
407 430
408 HistogramCustomizer histogram_customizer_; 431 HistogramCustomizer histogram_customizer_;
409 432
410 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 433 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
411 }; 434 };
412 435
413 } // namespace content 436 } // namespace content
414 437
415 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 438 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698