Chromium Code Reviews| 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/input_tag_speech_dispatcher.h" | 60 #include "content/renderer/input_tag_speech_dispatcher.h" |
| 60 #include "content/renderer/web_intents_host.h" | 61 #include "content/renderer/web_intents_host.h" |
| 61 #include "content/renderer/java/java_bridge_dispatcher.h" | 62 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 62 #include "content/renderer/load_progress_tracker.h" | 63 #include "content/renderer/load_progress_tracker.h" |
| 63 #include "content/renderer/media/audio_message_filter.h" | 64 #include "content/renderer/media/audio_message_filter.h" |
| 64 #include "content/renderer/media/audio_renderer_impl.h" | 65 #include "content/renderer/media/audio_renderer_impl.h" |
| 65 #include "content/renderer/media/media_stream_dependency_factory.h" | 66 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 66 #include "content/renderer/media/media_stream_dispatcher.h" | 67 #include "content/renderer/media/media_stream_dispatcher.h" |
| 67 #include "content/renderer/media/media_stream_impl.h" | 68 #include "content/renderer/media/media_stream_impl.h" |
| (...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2135 } | 2136 } |
| 2136 | 2137 |
| 2137 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 2138 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 2138 // Currently only cros/arm has any HW video decode support in | 2139 // Currently only cros/arm has any HW video decode support in |
| 2139 // GpuVideoDecodeAccelerator so we don't even try to use it on other | 2140 // GpuVideoDecodeAccelerator so we don't even try to use it on other |
| 2140 // platforms. This is a startup-time optimization. When new VDA | 2141 // platforms. This is a startup-time optimization. When new VDA |
| 2141 // implementations are added, relax the #if above. | 2142 // implementations are added, relax the #if above. |
| 2142 WebGraphicsContext3DCommandBufferImpl* context3d = | 2143 WebGraphicsContext3DCommandBufferImpl* context3d = |
| 2143 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 2144 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 2144 webview()->graphicsContext3D()); | 2145 webview()->graphicsContext3D()); |
| 2145 if (context3d && context3d->makeContextCurrent()) { | 2146 if (context3d) { |
| 2147 MessageLoop* factories_loop = | |
| 2148 RenderThreadImpl::current()->compositor_thread() ? | |
| 2149 RenderThreadImpl::current()->compositor_thread()->GetWebThread() | |
|
jamesr
2012/03/09 05:02:17
should we just have a message_loop() getter on com
| |
| 2150 ->message_loop() : | |
| 2151 MessageLoop::current(); | |
| 2146 GpuChannelHost* gpu_channel_host = | 2152 GpuChannelHost* gpu_channel_host = |
| 2147 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2153 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 2148 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2154 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 2149 collection->AddVideoDecoder(new media::GpuVideoDecoder( | 2155 collection->AddVideoDecoder(new media::GpuVideoDecoder( |
| 2150 message_loop_factory->GetMessageLoop("GpuVideoDecoder"), | 2156 message_loop_factory->GetMessageLoop("GpuVideoDecoder"), |
| 2157 factories_loop, | |
| 2151 new RendererGpuVideoDecoderFactories( | 2158 new RendererGpuVideoDecoderFactories( |
| 2152 gpu_channel_host, context3d->context()->AsWeakPtr()))); | 2159 gpu_channel_host, factories_loop, context3d))); |
| 2153 } | 2160 } |
| 2154 #endif | 2161 #endif |
| 2155 | 2162 |
| 2156 webkit_media::WebMediaPlayerImpl* media_player = | 2163 webkit_media::WebMediaPlayerImpl* media_player = |
| 2157 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2164 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
| 2158 this, frame, client, AsWeakPtr(), collection, audio_source_provider, | 2165 this, frame, client, AsWeakPtr(), collection, audio_source_provider, |
| 2159 message_loop_factory, media_stream_impl_.get(), render_media_log); | 2166 message_loop_factory, media_stream_impl_.get(), render_media_log); |
| 2160 #if defined(OS_ANDROID) | 2167 #if defined(OS_ANDROID) |
| 2161 // TODO(qinmin): Implement for android. | 2168 // TODO(qinmin): Implement for android. |
| 2162 // http://crbug.com/113218 | 2169 // http://crbug.com/113218 |
| (...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5117 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5124 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5118 return !!RenderThreadImpl::current()->compositor_thread(); | 5125 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5119 } | 5126 } |
| 5120 | 5127 |
| 5121 void RenderViewImpl::OnJavaBridgeInit() { | 5128 void RenderViewImpl::OnJavaBridgeInit() { |
| 5122 DCHECK(!java_bridge_dispatcher_.get()); | 5129 DCHECK(!java_bridge_dispatcher_.get()); |
| 5123 #if defined(ENABLE_JAVA_BRIDGE) | 5130 #if defined(ENABLE_JAVA_BRIDGE) |
| 5124 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5131 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 5125 #endif | 5132 #endif |
| 5126 } | 5133 } |
| OLD | NEW |