| 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 2820 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 webkit_media::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 webkit_media::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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 webkit_media::WebMediaPlayerParams params( |
| 2928 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 2935 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 2929 sink, gpu_factories, new RenderMediaLog()); | 2936 base::Bind(&ContentRendererClient::DeferMediaLoad, |
| 2930 WebMediaPlayer* media_player = | 2937 base::Unretained(GetContentClient()->renderer()), |
| 2931 GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2938 static_cast<RenderView*>(this)), |
| 2932 this, frame, client, AsWeakPtr(), params); | 2939 sink, |
| 2933 if (!media_player) { | 2940 gpu_factories, |
| 2934 media_player = new webkit_media::WebMediaPlayerImpl( | 2941 new RenderMediaLog()); |
| 2935 frame, client, AsWeakPtr(), params); | 2942 return new webkit_media::WebMediaPlayerImpl( |
| 2936 } | 2943 frame, client, AsWeakPtr(), params); |
| 2937 return media_player; | |
| 2938 } | 2944 } |
| 2939 | 2945 |
| 2940 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2946 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
| 2941 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2947 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 2942 if (!frame || !frame->view()) | 2948 if (!frame || !frame->view()) |
| 2943 return NULL; | 2949 return NULL; |
| 2944 return new RendererWebApplicationCacheHostImpl( | 2950 return new RendererWebApplicationCacheHostImpl( |
| 2945 FromWebView(frame->view()), client, | 2951 FromWebView(frame->view()), client, |
| 2946 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); | 2952 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); |
| 2947 } | 2953 } |
| (...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6764 WebURL url = icon_urls[i].iconURL(); | 6770 WebURL url = icon_urls[i].iconURL(); |
| 6765 if (!url.isEmpty()) | 6771 if (!url.isEmpty()) |
| 6766 urls.push_back(FaviconURL(url, | 6772 urls.push_back(FaviconURL(url, |
| 6767 ToFaviconType(icon_urls[i].iconType()))); | 6773 ToFaviconType(icon_urls[i].iconType()))); |
| 6768 } | 6774 } |
| 6769 SendUpdateFaviconURL(urls); | 6775 SendUpdateFaviconURL(urls); |
| 6770 } | 6776 } |
| 6771 | 6777 |
| 6772 | 6778 |
| 6773 } // namespace content | 6779 } // namespace content |
| OLD | NEW |