| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "content/renderer/load_progress_tracker.h" | 92 #include "content/renderer/load_progress_tracker.h" |
| 93 #include "content/renderer/media/audio_device_factory.h" | 93 #include "content/renderer/media/audio_device_factory.h" |
| 94 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 94 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 95 #include "content/renderer/media/media_stream_dependency_factory.h" | 95 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 96 #include "content/renderer/media/media_stream_dispatcher.h" | 96 #include "content/renderer/media/media_stream_dispatcher.h" |
| 97 #include "content/renderer/media/media_stream_impl.h" | 97 #include "content/renderer/media/media_stream_impl.h" |
| 98 #include "content/renderer/media/render_media_log.h" | 98 #include "content/renderer/media/render_media_log.h" |
| 99 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 99 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
| 100 #include "content/renderer/media/rtc_peer_connection_handler.h" | 100 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| 101 #include "content/renderer/media/video_capture_impl_manager.h" | 101 #include "content/renderer/media/video_capture_impl_manager.h" |
| 102 #include "content/renderer/media/webmediaplayer_impl.h" |
| 103 #include "content/renderer/media/webmediaplayer_ms.h" |
| 104 #include "content/renderer/media/webmediaplayer_params.h" |
| 102 #include "content/renderer/mhtml_generator.h" | 105 #include "content/renderer/mhtml_generator.h" |
| 103 #include "content/renderer/notification_provider.h" | 106 #include "content/renderer/notification_provider.h" |
| 104 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 107 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
| 105 #include "content/renderer/plugin_channel_host.h" | 108 #include "content/renderer/plugin_channel_host.h" |
| 106 #include "content/renderer/render_frame_impl.h" | 109 #include "content/renderer/render_frame_impl.h" |
| 107 #include "content/renderer/render_process.h" | 110 #include "content/renderer/render_process.h" |
| 108 #include "content/renderer/render_thread_impl.h" | 111 #include "content/renderer/render_thread_impl.h" |
| 109 #include "content/renderer/render_view_impl_params.h" | 112 #include "content/renderer/render_view_impl_params.h" |
| 110 #include "content/renderer/render_view_mouse_lock_dispatcher.h" | 113 #include "content/renderer/render_view_mouse_lock_dispatcher.h" |
| 111 #include "content/renderer/render_widget_fullscreen_pepper.h" | 114 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 #include "webkit/common/dom_storage/dom_storage_types.h" | 207 #include "webkit/common/dom_storage/dom_storage_types.h" |
| 205 #include "webkit/common/webdropdata.h" | 208 #include "webkit/common/webdropdata.h" |
| 206 #include "webkit/glue/webkit_glue.h" | 209 #include "webkit/glue/webkit_glue.h" |
| 207 #include "webkit/glue/weburlresponse_extradata_impl.h" | 210 #include "webkit/glue/weburlresponse_extradata_impl.h" |
| 208 #include "webkit/plugins/npapi/plugin_list.h" | 211 #include "webkit/plugins/npapi/plugin_list.h" |
| 209 #include "webkit/plugins/npapi/plugin_utils.h" | 212 #include "webkit/plugins/npapi/plugin_utils.h" |
| 210 #include "webkit/plugins/npapi/webplugin_delegate.h" | 213 #include "webkit/plugins/npapi/webplugin_delegate.h" |
| 211 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 214 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 212 #include "webkit/plugins/npapi/webplugin_impl.h" | 215 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 213 #include "webkit/renderer/appcache/web_application_cache_host_impl.h" | 216 #include "webkit/renderer/appcache/web_application_cache_host_impl.h" |
| 214 #include "webkit/renderer/media/webmediaplayer_impl.h" | |
| 215 #include "webkit/renderer/media/webmediaplayer_ms.h" | |
| 216 #include "webkit/renderer/media/webmediaplayer_params.h" | |
| 217 #include "webkit/renderer/webpreferences_renderer.h" | 217 #include "webkit/renderer/webpreferences_renderer.h" |
| 218 | 218 |
| 219 #if defined(OS_ANDROID) | 219 #if defined(OS_ANDROID) |
| 220 #include <cpu-features.h> | 220 #include <cpu-features.h> |
| 221 | 221 |
| 222 #include "content/common/android/device_telephony_info.h" | 222 #include "content/common/android/device_telephony_info.h" |
| 223 #include "content/common/gpu/client/context_provider_command_buffer.h" | 223 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 224 #include "content/renderer/android/address_detector.h" | 224 #include "content/renderer/android/address_detector.h" |
| 225 #include "content/renderer/android/content_detector.h" | 225 #include "content/renderer/android/content_detector.h" |
| 226 #include "content/renderer/android/email_detector.h" | 226 #include "content/renderer/android/email_detector.h" |
| (...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 } | 2831 } |
| 2832 } | 2832 } |
| 2833 | 2833 |
| 2834 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 2834 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
| 2835 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 2835 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
| 2836 FOR_EACH_OBSERVER( | 2836 FOR_EACH_OBSERVER( |
| 2837 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2837 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
| 2838 | 2838 |
| 2839 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2839 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 2840 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) | 2840 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
| 2841 if (MediaStreamImpl::CheckMediaStream(url)) { | 2841 MediaStreamClient* media_stream_client = |
| 2842 GetContentClient()->renderer()->OverrideCreateMediaStreamClient(); |
| 2843 if (!media_stream_client) { |
| 2844 EnsureMediaStreamImpl(); |
| 2845 media_stream_client = media_stream_impl_; |
| 2846 } |
| 2847 |
| 2848 if (media_stream_client->IsMediaStream(url)) { |
| 2842 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2849 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2843 bool found_neon = | 2850 bool found_neon = |
| 2844 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2851 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| 2845 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2852 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
| 2846 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2853 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2847 EnsureMediaStreamImpl(); | 2854 EnsureMediaStreamImpl(); |
| 2848 return new webkit_media::WebMediaPlayerMS( | 2855 return new WebMediaPlayerMS( |
| 2849 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); | 2856 frame, client, AsWeakPtr(), media_stream_client, new RenderMediaLog()); |
| 2850 } | 2857 } |
| 2851 #endif | 2858 #endif |
| 2852 | 2859 |
| 2853 #if defined(OS_ANDROID) | 2860 #if defined(OS_ANDROID) |
| 2854 GpuChannelHost* gpu_channel_host = | 2861 GpuChannelHost* gpu_channel_host = |
| 2855 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2862 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 2856 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2863 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 2857 if (!gpu_channel_host) { | 2864 if (!gpu_channel_host) { |
| 2858 LOG(ERROR) << "Failed to establish GPU channel for media player"; | 2865 LOG(ERROR) << "Failed to establish GPU channel for media player"; |
| 2859 return NULL; | 2866 return NULL; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2917 RenderThreadImpl::current()->compositor_message_loop_proxy(); | 2924 RenderThreadImpl::current()->compositor_message_loop_proxy(); |
| 2918 if (!factories_loop.get()) | 2925 if (!factories_loop.get()) |
| 2919 factories_loop = base::MessageLoopProxy::current(); | 2926 factories_loop = base::MessageLoopProxy::current(); |
| 2920 GpuChannelHost* gpu_channel_host = | 2927 GpuChannelHost* gpu_channel_host = |
| 2921 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2928 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 2922 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2929 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 2923 gpu_factories = new RendererGpuVideoDecoderFactories( | 2930 gpu_factories = new RendererGpuVideoDecoderFactories( |
| 2924 gpu_channel_host, factories_loop, context3d); | 2931 gpu_channel_host, factories_loop, context3d); |
| 2925 } | 2932 } |
| 2926 | 2933 |
| 2927 webkit_media::WebMediaPlayerParams params( | 2934 WebMediaPlayerParams params( |
| 2928 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 2935 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 2929 sink, gpu_factories, new RenderMediaLog()); | 2936 GetContentClient()->renderer()->OverrideCreateMediaPlayerLoadDelegate( |
| 2930 WebMediaPlayer* media_player = | 2937 this), |
| 2931 GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2938 sink, |
| 2932 this, frame, client, AsWeakPtr(), params); | 2939 gpu_factories, |
| 2933 if (!media_player) { | 2940 new RenderMediaLog()); |
| 2934 media_player = new webkit_media::WebMediaPlayerImpl( | 2941 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); |
| 2935 frame, client, AsWeakPtr(), params); | |
| 2936 } | |
| 2937 return media_player; | |
| 2938 } | 2942 } |
| 2939 | 2943 |
| 2940 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2944 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
| 2941 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2945 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 2942 if (!frame || !frame->view()) | 2946 if (!frame || !frame->view()) |
| 2943 return NULL; | 2947 return NULL; |
| 2944 return new RendererWebApplicationCacheHostImpl( | 2948 return new RendererWebApplicationCacheHostImpl( |
| 2945 FromWebView(frame->view()), client, | 2949 FromWebView(frame->view()), client, |
| 2946 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); | 2950 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); |
| 2947 } | 2951 } |
| (...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6764 WebURL url = icon_urls[i].iconURL(); | 6768 WebURL url = icon_urls[i].iconURL(); |
| 6765 if (!url.isEmpty()) | 6769 if (!url.isEmpty()) |
| 6766 urls.push_back(FaviconURL(url, | 6770 urls.push_back(FaviconURL(url, |
| 6767 ToFaviconType(icon_urls[i].iconType()))); | 6771 ToFaviconType(icon_urls[i].iconType()))); |
| 6768 } | 6772 } |
| 6769 SendUpdateFaviconURL(urls); | 6773 SendUpdateFaviconURL(urls); |
| 6770 } | 6774 } |
| 6771 | 6775 |
| 6772 | 6776 |
| 6773 } // namespace content | 6777 } // namespace content |
| OLD | NEW |