| 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 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "content/renderer/load_progress_tracker.h" | 94 #include "content/renderer/load_progress_tracker.h" |
| 95 #include "content/renderer/media/audio_device_factory.h" | 95 #include "content/renderer/media/audio_device_factory.h" |
| 96 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 96 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 97 #include "content/renderer/media/media_stream_dependency_factory.h" | 97 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 98 #include "content/renderer/media/media_stream_dispatcher.h" | 98 #include "content/renderer/media/media_stream_dispatcher.h" |
| 99 #include "content/renderer/media/media_stream_impl.h" | 99 #include "content/renderer/media/media_stream_impl.h" |
| 100 #include "content/renderer/media/render_media_log.h" | 100 #include "content/renderer/media/render_media_log.h" |
| 101 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 101 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
| 102 #include "content/renderer/media/rtc_peer_connection_handler.h" | 102 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| 103 #include "content/renderer/media/video_capture_impl_manager.h" | 103 #include "content/renderer/media/video_capture_impl_manager.h" |
| 104 #include "content/renderer/media/webmediaplayer_impl.h" |
| 105 #include "content/renderer/media/webmediaplayer_ms.h" |
| 106 #include "content/renderer/media/webmediaplayer_params.h" |
| 104 #include "content/renderer/mhtml_generator.h" | 107 #include "content/renderer/mhtml_generator.h" |
| 105 #include "content/renderer/notification_provider.h" | 108 #include "content/renderer/notification_provider.h" |
| 106 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 109 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
| 107 #include "content/renderer/plugin_channel_host.h" | 110 #include "content/renderer/plugin_channel_host.h" |
| 108 #include "content/renderer/render_frame_impl.h" | 111 #include "content/renderer/render_frame_impl.h" |
| 109 #include "content/renderer/render_process.h" | 112 #include "content/renderer/render_process.h" |
| 110 #include "content/renderer/render_thread_impl.h" | 113 #include "content/renderer/render_thread_impl.h" |
| 111 #include "content/renderer/render_view_impl_params.h" | 114 #include "content/renderer/render_view_impl_params.h" |
| 112 #include "content/renderer/render_view_mouse_lock_dispatcher.h" | 115 #include "content/renderer/render_view_mouse_lock_dispatcher.h" |
| 113 #include "content/renderer/render_widget_fullscreen_pepper.h" | 116 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 #include "v8/include/v8.h" | 208 #include "v8/include/v8.h" |
| 206 #include "webkit/common/dom_storage/dom_storage_types.h" | 209 #include "webkit/common/dom_storage/dom_storage_types.h" |
| 207 #include "webkit/glue/webkit_glue.h" | 210 #include "webkit/glue/webkit_glue.h" |
| 208 #include "webkit/glue/weburlresponse_extradata_impl.h" | 211 #include "webkit/glue/weburlresponse_extradata_impl.h" |
| 209 #include "webkit/plugins/npapi/plugin_list.h" | 212 #include "webkit/plugins/npapi/plugin_list.h" |
| 210 #include "webkit/plugins/npapi/plugin_utils.h" | 213 #include "webkit/plugins/npapi/plugin_utils.h" |
| 211 #include "webkit/plugins/npapi/webplugin_delegate.h" | 214 #include "webkit/plugins/npapi/webplugin_delegate.h" |
| 212 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 215 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 213 #include "webkit/plugins/npapi/webplugin_impl.h" | 216 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 214 #include "webkit/renderer/appcache/web_application_cache_host_impl.h" | 217 #include "webkit/renderer/appcache/web_application_cache_host_impl.h" |
| 215 #include "webkit/renderer/media/webmediaplayer_impl.h" | |
| 216 #include "webkit/renderer/media/webmediaplayer_ms.h" | |
| 217 #include "webkit/renderer/media/webmediaplayer_params.h" | |
| 218 #include "webkit/renderer/webpreferences_renderer.h" | 218 #include "webkit/renderer/webpreferences_renderer.h" |
| 219 | 219 |
| 220 #if defined(OS_ANDROID) | 220 #if defined(OS_ANDROID) |
| 221 #include <cpu-features.h> | 221 #include <cpu-features.h> |
| 222 | 222 |
| 223 #include "content/common/android/device_telephony_info.h" | 223 #include "content/common/android/device_telephony_info.h" |
| 224 #include "content/common/gpu/client/context_provider_command_buffer.h" | 224 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 225 #include "content/renderer/android/address_detector.h" | 225 #include "content/renderer/android/address_detector.h" |
| 226 #include "content/renderer/android/content_detector.h" | 226 #include "content/renderer/android/content_detector.h" |
| 227 #include "content/renderer/android/email_detector.h" | 227 #include "content/renderer/android/email_detector.h" |
| (...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2858 | 2858 |
| 2859 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2859 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 2860 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) | 2860 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
| 2861 EnsureMediaStreamClient(); | 2861 EnsureMediaStreamClient(); |
| 2862 if (media_stream_client_->IsMediaStream(url)) { | 2862 if (media_stream_client_->IsMediaStream(url)) { |
| 2863 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2863 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2864 bool found_neon = | 2864 bool found_neon = |
| 2865 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2865 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| 2866 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2866 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
| 2867 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2867 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2868 return new webkit_media::WebMediaPlayerMS( | 2868 return new WebMediaPlayerMS( |
| 2869 frame, client, AsWeakPtr(), media_stream_client_, new RenderMediaLog()); | 2869 frame, client, AsWeakPtr(), media_stream_client_, new RenderMediaLog()); |
| 2870 } | 2870 } |
| 2871 #endif | 2871 #endif |
| 2872 | 2872 |
| 2873 #if defined(OS_ANDROID) | 2873 #if defined(OS_ANDROID) |
| 2874 GpuChannelHost* gpu_channel_host = | 2874 GpuChannelHost* gpu_channel_host = |
| 2875 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2875 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 2876 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2876 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 2877 if (!gpu_channel_host) { | 2877 if (!gpu_channel_host) { |
| 2878 LOG(ERROR) << "Failed to establish GPU channel for media player"; | 2878 LOG(ERROR) << "Failed to establish GPU channel for media player"; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2937 RenderThreadImpl::current()->compositor_message_loop_proxy(); | 2937 RenderThreadImpl::current()->compositor_message_loop_proxy(); |
| 2938 if (!factories_loop.get()) | 2938 if (!factories_loop.get()) |
| 2939 factories_loop = base::MessageLoopProxy::current(); | 2939 factories_loop = base::MessageLoopProxy::current(); |
| 2940 GpuChannelHost* gpu_channel_host = | 2940 GpuChannelHost* gpu_channel_host = |
| 2941 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2941 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 2942 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2942 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 2943 gpu_factories = new RendererGpuVideoDecoderFactories( | 2943 gpu_factories = new RendererGpuVideoDecoderFactories( |
| 2944 gpu_channel_host, factories_loop, context3d); | 2944 gpu_channel_host, factories_loop, context3d); |
| 2945 } | 2945 } |
| 2946 | 2946 |
| 2947 webkit_media::WebMediaPlayerParams params( | 2947 WebMediaPlayerParams params( |
| 2948 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 2948 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 2949 base::Bind(&ContentRendererClient::DeferMediaLoad, | 2949 base::Bind(&ContentRendererClient::DeferMediaLoad, |
| 2950 base::Unretained(GetContentClient()->renderer()), | 2950 base::Unretained(GetContentClient()->renderer()), |
| 2951 static_cast<RenderView*>(this)), | 2951 static_cast<RenderView*>(this)), |
| 2952 sink, | 2952 sink, |
| 2953 gpu_factories, | 2953 gpu_factories, |
| 2954 new RenderMediaLog()); | 2954 new RenderMediaLog()); |
| 2955 return new webkit_media::WebMediaPlayerImpl( | 2955 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); |
| 2956 frame, client, AsWeakPtr(), params); | |
| 2957 } | 2956 } |
| 2958 | 2957 |
| 2959 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2958 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
| 2960 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2959 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 2961 if (!frame || !frame->view()) | 2960 if (!frame || !frame->view()) |
| 2962 return NULL; | 2961 return NULL; |
| 2963 return new RendererWebApplicationCacheHostImpl( | 2962 return new RendererWebApplicationCacheHostImpl( |
| 2964 FromWebView(frame->view()), client, | 2963 FromWebView(frame->view()), client, |
| 2965 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); | 2964 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); |
| 2966 } | 2965 } |
| (...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6750 void RenderViewImpl::EnableAutoResizeForTesting(const gfx::Size& min_size, | 6749 void RenderViewImpl::EnableAutoResizeForTesting(const gfx::Size& min_size, |
| 6751 const gfx::Size& max_size) { | 6750 const gfx::Size& max_size) { |
| 6752 OnEnableAutoResize(min_size, max_size); | 6751 OnEnableAutoResize(min_size, max_size); |
| 6753 } | 6752 } |
| 6754 | 6753 |
| 6755 void RenderViewImpl::DisableAutoResizeForTesting(const gfx::Size& new_size) { | 6754 void RenderViewImpl::DisableAutoResizeForTesting(const gfx::Size& new_size) { |
| 6756 OnDisableAutoResize(new_size); | 6755 OnDisableAutoResize(new_size); |
| 6757 } | 6756 } |
| 6758 | 6757 |
| 6759 void RenderViewImpl::SetMediaStreamClientForTesting( | 6758 void RenderViewImpl::SetMediaStreamClientForTesting( |
| 6760 webkit_media::MediaStreamClient* media_stream_client) { | 6759 MediaStreamClient* media_stream_client) { |
| 6761 DCHECK(!media_stream_client_); | 6760 DCHECK(!media_stream_client_); |
| 6762 DCHECK(!web_user_media_client_); | 6761 DCHECK(!web_user_media_client_); |
| 6763 media_stream_client_ = media_stream_client; | 6762 media_stream_client_ = media_stream_client; |
| 6764 } | 6763 } |
| 6765 | 6764 |
| 6766 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6765 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
| 6767 TransportDIB::Handle dib_handle) { | 6766 TransportDIB::Handle dib_handle) { |
| 6768 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6767 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6769 RenderProcess::current()->ReleaseTransportDIB(dib); | 6768 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6770 } | 6769 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 6792 WebURL url = icon_urls[i].iconURL(); | 6791 WebURL url = icon_urls[i].iconURL(); |
| 6793 if (!url.isEmpty()) | 6792 if (!url.isEmpty()) |
| 6794 urls.push_back(FaviconURL(url, | 6793 urls.push_back(FaviconURL(url, |
| 6795 ToFaviconType(icon_urls[i].iconType()))); | 6794 ToFaviconType(icon_urls[i].iconType()))); |
| 6796 } | 6795 } |
| 6797 SendUpdateFaviconURL(urls); | 6796 SendUpdateFaviconURL(urls); |
| 6798 } | 6797 } |
| 6799 | 6798 |
| 6800 | 6799 |
| 6801 } // namespace content | 6800 } // namespace content |
| OLD | NEW |