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 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2845 } | 2845 } |
2846 } | 2846 } |
2847 | 2847 |
2848 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 2848 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
2849 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 2849 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
2850 FOR_EACH_OBSERVER( | 2850 FOR_EACH_OBSERVER( |
2851 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2851 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
2852 | 2852 |
2853 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2853 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2854 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) | 2854 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
2855 if (MediaStreamImpl::CheckMediaStream(url)) { | 2855 webkit_media::MediaStreamClient* media_stream_client = |
2856 GetContentClient()->renderer()->OverrideCreateMediaStreamClient(); | |
2857 if (!media_stream_client) { | |
2858 EnsureMediaStreamImpl(); | |
2859 media_stream_client = media_stream_impl_; | |
2860 } | |
2861 | |
2862 if (media_stream_client->IsMediaStream(url)) { | |
2856 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2863 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
2857 bool found_neon = | 2864 bool found_neon = |
2858 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2865 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
2859 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2866 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
2860 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2867 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
2861 EnsureMediaStreamImpl(); | 2868 EnsureMediaStreamImpl(); |
ycheo (away)
2013/07/03 02:41:04
QQ) Is this needed?
If it is, should we use 'media
scherkus (not reviewing)
2013/07/03 20:10:30
no it is no longer needed
| |
2862 return new webkit_media::WebMediaPlayerMS( | 2869 return new webkit_media::WebMediaPlayerMS( |
2863 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); | 2870 frame, client, AsWeakPtr(), media_stream_client, new RenderMediaLog()); |
2864 } | 2871 } |
2865 #endif | 2872 #endif |
2866 | 2873 |
2867 #if defined(OS_ANDROID) | 2874 #if defined(OS_ANDROID) |
2868 GpuChannelHost* gpu_channel_host = | 2875 GpuChannelHost* gpu_channel_host = |
2869 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2876 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2870 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2877 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2871 if (!gpu_channel_host) { | 2878 if (!gpu_channel_host) { |
2872 LOG(ERROR) << "Failed to establish GPU channel for media player"; | 2879 LOG(ERROR) << "Failed to establish GPU channel for media player"; |
2873 return NULL; | 2880 return NULL; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2933 factories_loop = base::MessageLoopProxy::current(); | 2940 factories_loop = base::MessageLoopProxy::current(); |
2934 GpuChannelHost* gpu_channel_host = | 2941 GpuChannelHost* gpu_channel_host = |
2935 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2942 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2936 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2943 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2937 gpu_factories = new RendererGpuVideoDecoderFactories( | 2944 gpu_factories = new RendererGpuVideoDecoderFactories( |
2938 gpu_channel_host, factories_loop, context3d); | 2945 gpu_channel_host, factories_loop, context3d); |
2939 } | 2946 } |
2940 | 2947 |
2941 webkit_media::WebMediaPlayerParams params( | 2948 webkit_media::WebMediaPlayerParams params( |
2942 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 2949 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
2943 sink, gpu_factories, new RenderMediaLog()); | 2950 base::Bind(&ContentRendererClient::DeferMediaLoad, |
2944 WebMediaPlayer* media_player = | 2951 base::Unretained(GetContentClient()->renderer()), |
2945 GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2952 static_cast<RenderView*>(this)), |
2946 this, frame, client, AsWeakPtr(), params); | 2953 sink, |
2947 if (!media_player) { | 2954 gpu_factories, |
2948 media_player = new webkit_media::WebMediaPlayerImpl( | 2955 new RenderMediaLog()); |
2949 frame, client, AsWeakPtr(), params); | 2956 return new webkit_media::WebMediaPlayerImpl( |
2950 } | 2957 frame, client, AsWeakPtr(), params); |
2951 return media_player; | |
2952 } | 2958 } |
2953 | 2959 |
2954 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2960 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
2955 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2961 WebFrame* frame, WebApplicationCacheHostClient* client) { |
2956 if (!frame || !frame->view()) | 2962 if (!frame || !frame->view()) |
2957 return NULL; | 2963 return NULL; |
2958 return new RendererWebApplicationCacheHostImpl( | 2964 return new RendererWebApplicationCacheHostImpl( |
2959 FromWebView(frame->view()), client, | 2965 FromWebView(frame->view()), client, |
2960 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); | 2966 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); |
2961 } | 2967 } |
(...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6778 WebURL url = icon_urls[i].iconURL(); | 6784 WebURL url = icon_urls[i].iconURL(); |
6779 if (!url.isEmpty()) | 6785 if (!url.isEmpty()) |
6780 urls.push_back(FaviconURL(url, | 6786 urls.push_back(FaviconURL(url, |
6781 ToFaviconType(icon_urls[i].iconType()))); | 6787 ToFaviconType(icon_urls[i].iconType()))); |
6782 } | 6788 } |
6783 SendUpdateFaviconURL(urls); | 6789 SendUpdateFaviconURL(urls); |
6784 } | 6790 } |
6785 | 6791 |
6786 | 6792 |
6787 } // namespace content | 6793 } // namespace content |
OLD | NEW |