Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 18590002: Migrate MediaStream test code from content/shell/renderer/ to content/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 webkit_media::MediaStreamClient* media_stream_client = 2855 MediaStreamClient* media_stream_client =
2856 GetContentClient()->renderer()->OverrideCreateMediaStreamClient(); 2856 GetContentClient()->renderer()->OverrideCreateMediaStreamClient();
2857 if (!media_stream_client) { 2857 if (!media_stream_client) {
2858 EnsureMediaStreamImpl(); 2858 EnsureMediaStreamImpl();
2859 media_stream_client = media_stream_impl_; 2859 media_stream_client = media_stream_impl_;
2860 } 2860 }
2861 2861
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 EnsureMediaStreamImpl(); 2868 EnsureMediaStreamImpl();
2869 return new webkit_media::WebMediaPlayerMS( 2869 return new WebMediaPlayerMS(
2870 frame, client, AsWeakPtr(), media_stream_client, new RenderMediaLog()); 2870 frame, client, AsWeakPtr(), media_stream_client, new RenderMediaLog());
2871 } 2871 }
2872 #endif 2872 #endif
2873 2873
2874 #if defined(OS_ANDROID) 2874 #if defined(OS_ANDROID)
2875 GpuChannelHost* gpu_channel_host = 2875 GpuChannelHost* gpu_channel_host =
2876 RenderThreadImpl::current()->EstablishGpuChannelSync( 2876 RenderThreadImpl::current()->EstablishGpuChannelSync(
2877 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2877 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2878 if (!gpu_channel_host) { 2878 if (!gpu_channel_host) {
2879 LOG(ERROR) << "Failed to establish GPU channel for media player"; 2879 LOG(ERROR) << "Failed to establish GPU channel for media player";
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2938 RenderThreadImpl::current()->compositor_message_loop_proxy(); 2938 RenderThreadImpl::current()->compositor_message_loop_proxy();
2939 if (!factories_loop.get()) 2939 if (!factories_loop.get())
2940 factories_loop = base::MessageLoopProxy::current(); 2940 factories_loop = base::MessageLoopProxy::current();
2941 GpuChannelHost* gpu_channel_host = 2941 GpuChannelHost* gpu_channel_host =
2942 RenderThreadImpl::current()->EstablishGpuChannelSync( 2942 RenderThreadImpl::current()->EstablishGpuChannelSync(
2943 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2943 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2944 gpu_factories = new RendererGpuVideoDecoderFactories( 2944 gpu_factories = new RendererGpuVideoDecoderFactories(
2945 gpu_channel_host, factories_loop, context3d); 2945 gpu_channel_host, factories_loop, context3d);
2946 } 2946 }
2947 2947
2948 webkit_media::WebMediaPlayerParams params( 2948 WebMediaPlayerParams params(
2949 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), 2949 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
2950 base::Bind(&ContentRendererClient::DeferMediaLoad, 2950 base::Bind(&ContentRendererClient::DeferMediaLoad,
2951 base::Unretained(GetContentClient()->renderer()), 2951 base::Unretained(GetContentClient()->renderer()),
2952 static_cast<RenderView*>(this)), 2952 static_cast<RenderView*>(this)),
2953 sink, 2953 sink,
2954 gpu_factories, 2954 gpu_factories,
2955 new RenderMediaLog()); 2955 new RenderMediaLog());
2956 return new webkit_media::WebMediaPlayerImpl( 2956 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params);
2957 frame, client, AsWeakPtr(), params);
2958 } 2957 }
2959 2958
2960 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( 2959 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost(
2961 WebFrame* frame, WebApplicationCacheHostClient* client) { 2960 WebFrame* frame, WebApplicationCacheHostClient* client) {
2962 if (!frame || !frame->view()) 2961 if (!frame || !frame->view())
2963 return NULL; 2962 return NULL;
2964 return new RendererWebApplicationCacheHostImpl( 2963 return new RendererWebApplicationCacheHostImpl(
2965 FromWebView(frame->view()), client, 2964 FromWebView(frame->view()), client,
2966 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy()); 2965 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy());
2967 } 2966 }
(...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after
6784 WebURL url = icon_urls[i].iconURL(); 6783 WebURL url = icon_urls[i].iconURL();
6785 if (!url.isEmpty()) 6784 if (!url.isEmpty())
6786 urls.push_back(FaviconURL(url, 6785 urls.push_back(FaviconURL(url,
6787 ToFaviconType(icon_urls[i].iconType()))); 6786 ToFaviconType(icon_urls[i].iconType())));
6788 } 6787 }
6789 SendUpdateFaviconURL(urls); 6788 SendUpdateFaviconURL(urls);
6790 } 6789 }
6791 6790
6792 6791
6793 } // namespace content 6792 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698