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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "content/public/renderer/content_renderer_client.h" | 48 #include "content/public/renderer/content_renderer_client.h" |
49 #include "content/public/renderer/document_state.h" | 49 #include "content/public/renderer/document_state.h" |
50 #include "content/public/renderer/navigation_state.h" | 50 #include "content/public/renderer/navigation_state.h" |
51 #include "content/public/renderer/render_view_observer.h" | 51 #include "content/public/renderer/render_view_observer.h" |
52 #include "content/public/renderer/render_view_visitor.h" | 52 #include "content/public/renderer/render_view_visitor.h" |
53 #include "content/renderer/device_orientation_dispatcher.h" | 53 #include "content/renderer/device_orientation_dispatcher.h" |
54 #include "content/renderer/devtools_agent.h" | 54 #include "content/renderer/devtools_agent.h" |
55 #include "content/renderer/dom_automation_controller.h" | 55 #include "content/renderer/dom_automation_controller.h" |
56 #include "content/renderer/external_popup_menu.h" | 56 #include "content/renderer/external_popup_menu.h" |
57 #include "content/renderer/geolocation_dispatcher.h" | 57 #include "content/renderer/geolocation_dispatcher.h" |
| 58 #include "content/renderer/gpu/compositor_thread.h" |
58 #include "content/renderer/idle_user_detector.h" | 59 #include "content/renderer/idle_user_detector.h" |
59 #include "content/renderer/web_intents_host.h" | 60 #include "content/renderer/web_intents_host.h" |
60 #include "content/renderer/java/java_bridge_dispatcher.h" | 61 #include "content/renderer/java/java_bridge_dispatcher.h" |
61 #include "content/renderer/load_progress_tracker.h" | 62 #include "content/renderer/load_progress_tracker.h" |
62 #include "content/renderer/media/audio_message_filter.h" | 63 #include "content/renderer/media/audio_message_filter.h" |
63 #include "content/renderer/media/audio_renderer_impl.h" | 64 #include "content/renderer/media/audio_renderer_impl.h" |
64 #include "content/renderer/media/media_stream_dependency_factory.h" | 65 #include "content/renderer/media/media_stream_dependency_factory.h" |
65 #include "content/renderer/media/media_stream_dispatcher.h" | 66 #include "content/renderer/media/media_stream_dispatcher.h" |
66 #include "content/renderer/media/media_stream_impl.h" | 67 #include "content/renderer/media/media_stream_impl.h" |
67 #include "content/renderer/media/render_audiosourceprovider.h" | 68 #include "content/renderer/media/render_audiosourceprovider.h" |
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 } | 2129 } |
2129 | 2130 |
2130 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 2131 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
2131 // Currently only cros/arm has any HW video decode support in | 2132 // Currently only cros/arm has any HW video decode support in |
2132 // GpuVideoDecodeAccelerator so we don't even try to use it on other | 2133 // GpuVideoDecodeAccelerator so we don't even try to use it on other |
2133 // platforms. This is a startup-time optimization. When new VDA | 2134 // platforms. This is a startup-time optimization. When new VDA |
2134 // implementations are added, relax the #if above. | 2135 // implementations are added, relax the #if above. |
2135 WebGraphicsContext3DCommandBufferImpl* context3d = | 2136 WebGraphicsContext3DCommandBufferImpl* context3d = |
2136 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 2137 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
2137 webview()->graphicsContext3D()); | 2138 webview()->graphicsContext3D()); |
2138 if (context3d && context3d->makeContextCurrent()) { | 2139 if (context3d) { |
| 2140 MessageLoop* factories_loop = |
| 2141 RenderThreadImpl::current()->compositor_thread() ? |
| 2142 RenderThreadImpl::current()->compositor_thread()->GetWebThread() |
| 2143 ->message_loop() : |
| 2144 MessageLoop::current(); |
2139 GpuChannelHost* gpu_channel_host = | 2145 GpuChannelHost* gpu_channel_host = |
2140 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2146 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2141 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2147 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2142 collection->AddVideoDecoder(new media::GpuVideoDecoder( | 2148 collection->AddVideoDecoder(new media::GpuVideoDecoder( |
2143 message_loop_factory->GetMessageLoop("GpuVideoDecoder"), | 2149 message_loop_factory->GetMessageLoop("GpuVideoDecoder"), |
| 2150 factories_loop, |
2144 new RendererGpuVideoDecoderFactories( | 2151 new RendererGpuVideoDecoderFactories( |
2145 gpu_channel_host, context3d->context()->AsWeakPtr()))); | 2152 gpu_channel_host, factories_loop, context3d))); |
2146 } | 2153 } |
2147 #endif | 2154 #endif |
2148 | 2155 |
2149 webkit_media::WebMediaPlayerImpl* media_player = | 2156 webkit_media::WebMediaPlayerImpl* media_player = |
2150 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2157 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
2151 this, frame, client, AsWeakPtr(), collection, audio_source_provider, | 2158 this, frame, client, AsWeakPtr(), collection, audio_source_provider, |
2152 message_loop_factory, media_stream_impl_.get(), render_media_log); | 2159 message_loop_factory, media_stream_impl_.get(), render_media_log); |
2153 #if defined(OS_ANDROID) | 2160 #if defined(OS_ANDROID) |
2154 // TODO(qinmin): Implement for android. | 2161 // TODO(qinmin): Implement for android. |
2155 // http://crbug.com/113218 | 2162 // http://crbug.com/113218 |
(...skipping 2930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5086 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5093 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5087 return !!RenderThreadImpl::current()->compositor_thread(); | 5094 return !!RenderThreadImpl::current()->compositor_thread(); |
5088 } | 5095 } |
5089 | 5096 |
5090 void RenderViewImpl::OnJavaBridgeInit() { | 5097 void RenderViewImpl::OnJavaBridgeInit() { |
5091 DCHECK(!java_bridge_dispatcher_.get()); | 5098 DCHECK(!java_bridge_dispatcher_.get()); |
5092 #if defined(ENABLE_JAVA_BRIDGE) | 5099 #if defined(ENABLE_JAVA_BRIDGE) |
5093 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5100 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5094 #endif | 5101 #endif |
5095 } | 5102 } |
OLD | NEW |