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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 70 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
71 #include "content/renderer/input/input_event_filter.h" | 71 #include "content/renderer/input/input_event_filter.h" |
72 #include "content/renderer/input/input_handler_manager.h" | 72 #include "content/renderer/input/input_handler_manager.h" |
73 #include "content/renderer/media/audio_input_message_filter.h" | 73 #include "content/renderer/media/audio_input_message_filter.h" |
74 #include "content/renderer/media/audio_message_filter.h" | 74 #include "content/renderer/media/audio_message_filter.h" |
75 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 75 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
76 #include "content/renderer/media/media_stream_center.h" | 76 #include "content/renderer/media/media_stream_center.h" |
77 #include "content/renderer/media/media_stream_dependency_factory.h" | 77 #include "content/renderer/media/media_stream_dependency_factory.h" |
78 #include "content/renderer/media/midi_message_filter.h" | 78 #include "content/renderer/media/midi_message_filter.h" |
79 #include "content/renderer/media/peer_connection_tracker.h" | 79 #include "content/renderer/media/peer_connection_tracker.h" |
80 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" | |
81 #include "content/renderer/media/video_capture_impl_manager.h" | 80 #include "content/renderer/media/video_capture_impl_manager.h" |
82 #include "content/renderer/media/video_capture_message_filter.h" | 81 #include "content/renderer/media/video_capture_message_filter.h" |
83 #include "content/renderer/media/webrtc_identity_service.h" | 82 #include "content/renderer/media/webrtc_identity_service.h" |
84 #include "content/renderer/p2p/socket_dispatcher.h" | 83 #include "content/renderer/p2p/socket_dispatcher.h" |
85 #include "content/renderer/render_process_impl.h" | 84 #include "content/renderer/render_process_impl.h" |
86 #include "content/renderer/render_view_impl.h" | 85 #include "content/renderer/render_view_impl.h" |
87 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 86 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
88 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 87 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
89 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 88 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
90 #include "grit/content_resources.h" | 89 #include "grit/content_resources.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { | 881 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { |
883 bool result = false; | 882 bool result = false; |
884 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list)); | 883 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list)); |
885 return result; | 884 return result; |
886 } | 885 } |
887 | 886 |
888 void RenderThreadImpl::PostponeIdleNotification() { | 887 void RenderThreadImpl::PostponeIdleNotification() { |
889 idle_notifications_to_skip_ = 2; | 888 idle_notifications_to_skip_ = 2; |
890 } | 889 } |
891 | 890 |
892 scoped_refptr<media::GpuVideoAcceleratorFactories> | 891 scoped_refptr<RendererGpuVideoAcceleratorFactories> |
893 RenderThreadImpl::GetGpuFactories() { | 892 RenderThreadImpl::GetGpuFactories() { |
894 DCHECK(IsMainThread()); | 893 DCHECK(IsMainThread()); |
895 | 894 |
896 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); | 895 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); |
897 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 896 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
898 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories; | 897 scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories; |
899 scoped_refptr<base::MessageLoopProxy> media_loop_proxy = | 898 scoped_refptr<base::MessageLoopProxy> media_loop_proxy = |
900 GetMediaThreadMessageLoopProxy(); | 899 GetMediaThreadMessageLoopProxy(); |
901 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) { | 900 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) { |
902 if (!gpu_va_context_provider_ || | 901 if (!gpu_va_context_provider_ || |
903 gpu_va_context_provider_->DestroyedOnMainThread()) { | 902 gpu_va_context_provider_->DestroyedOnMainThread()) { |
904 if (!gpu_channel_host) { | 903 if (!gpu_channel_host) { |
905 gpu_channel_host = EstablishGpuChannelSync( | 904 gpu_channel_host = EstablishGpuChannelSync( |
906 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); | 905 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); |
907 } | 906 } |
908 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( | 907 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( |
909 make_scoped_ptr( | 908 make_scoped_ptr( |
910 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 909 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
911 gpu_channel_host.get(), | 910 gpu_channel_host.get(), |
912 blink::WebGraphicsContext3D::Attributes(), | 911 blink::WebGraphicsContext3D::Attributes(), |
913 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), | 912 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), |
914 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), | 913 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
915 NULL)), | 914 NULL)), |
916 "GPU-VideoAccelerator-Offscreen"); | 915 "GPU-VideoAccelerator-Offscreen"); |
| 916 if (gpu_va_context_provider_) { |
| 917 media_loop_proxy->PostTask( |
| 918 FROM_HERE, |
| 919 base::Bind( |
| 920 base::IgnoreResult(&cc::ContextProvider::BindToCurrentThread), |
| 921 gpu_va_context_provider_)); |
| 922 } |
917 } | 923 } |
918 } | 924 } |
919 if (gpu_va_context_provider_) { | 925 if (gpu_va_context_provider_) { |
920 gpu_factories = new RendererGpuVideoAcceleratorFactories( | 926 gpu_factories = new RendererGpuVideoAcceleratorFactories( |
921 gpu_channel_host, media_loop_proxy, gpu_va_context_provider_); | 927 gpu_channel_host, media_loop_proxy, gpu_va_context_provider_); |
922 } | 928 } |
923 return gpu_factories; | 929 return gpu_factories; |
924 } | 930 } |
925 | 931 |
926 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 932 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 hidden_widget_count_--; | 1417 hidden_widget_count_--; |
1412 | 1418 |
1413 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1419 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1414 return; | 1420 return; |
1415 } | 1421 } |
1416 | 1422 |
1417 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1423 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1418 } | 1424 } |
1419 | 1425 |
1420 } // namespace content | 1426 } // namespace content |
OLD | NEW |