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