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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 185 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
186 #include "webkit/glue/dom_operations.h" | 186 #include "webkit/glue/dom_operations.h" |
187 #include "webkit/glue/glue_serialize.h" | 187 #include "webkit/glue/glue_serialize.h" |
188 #include "webkit/glue/web_intent_service_data.h" | 188 #include "webkit/glue/web_intent_service_data.h" |
189 #include "webkit/glue/webdropdata.h" | 189 #include "webkit/glue/webdropdata.h" |
190 #include "webkit/glue/webkit_constants.h" | 190 #include "webkit/glue/webkit_constants.h" |
191 #include "webkit/glue/webkit_glue.h" | 191 #include "webkit/glue/webkit_glue.h" |
192 #include "webkit/glue/weburlresponse_extradata_impl.h" | 192 #include "webkit/glue/weburlresponse_extradata_impl.h" |
193 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 193 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
194 #include "webkit/media/webmediaplayer_impl.h" | 194 #include "webkit/media/webmediaplayer_impl.h" |
| 195 #include "webkit/media/webmediaplayer_ms.h" |
195 #include "webkit/plugins/npapi/plugin_list.h" | 196 #include "webkit/plugins/npapi/plugin_list.h" |
196 #include "webkit/plugins/npapi/webplugin_delegate.h" | 197 #include "webkit/plugins/npapi/webplugin_delegate.h" |
197 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 198 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
198 #include "webkit/plugins/npapi/webplugin_impl.h" | 199 #include "webkit/plugins/npapi/webplugin_impl.h" |
199 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 200 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
200 | 201 |
201 #if defined(OS_ANDROID) | 202 #if defined(OS_ANDROID) |
202 #include "content/common/android/device_info.h" | 203 #include "content/common/android/device_info.h" |
203 #include "content/renderer/android/address_detector.h" | 204 #include "content/renderer/android/address_detector.h" |
204 #include "content/renderer/android/content_detector.h" | 205 #include "content/renderer/android/content_detector.h" |
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 audio_source_provider = new RenderAudioSourceProvider(); | 2555 audio_source_provider = new RenderAudioSourceProvider(); |
2555 | 2556 |
2556 // Add the chrome specific audio renderer, using audio_source_provider | 2557 // Add the chrome specific audio renderer, using audio_source_provider |
2557 // as the sink. | 2558 // as the sink. |
2558 media::AudioRendererImpl* audio_renderer = | 2559 media::AudioRendererImpl* audio_renderer = |
2559 new media::AudioRendererImpl(audio_source_provider); | 2560 new media::AudioRendererImpl(audio_source_provider); |
2560 collection->AddAudioRenderer(audio_renderer); | 2561 collection->AddAudioRenderer(audio_renderer); |
2561 } | 2562 } |
2562 | 2563 |
2563 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | 2564 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; |
2564 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 2565 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
2565 switches::kDisableAcceleratedVideoDecode)) | |
2566 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); | 2566 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); |
2567 if (context3d) { | 2567 if (context3d) { |
2568 scoped_refptr<base::MessageLoopProxy> factories_loop = | 2568 scoped_refptr<base::MessageLoopProxy> factories_loop = |
2569 RenderThreadImpl::current()->compositor_thread() ? | 2569 RenderThreadImpl::current()->compositor_thread() ? |
2570 RenderThreadImpl::current()->compositor_thread()->GetWebThread() | 2570 RenderThreadImpl::current()->compositor_thread()->GetWebThread() |
2571 ->message_loop()->message_loop_proxy() : | 2571 ->message_loop()->message_loop_proxy() : |
2572 base::MessageLoopProxy::current(); | 2572 base::MessageLoopProxy::current(); |
2573 GpuChannelHost* gpu_channel_host = | 2573 GpuChannelHost* gpu_channel_host = |
2574 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2574 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2575 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2575 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2576 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( | 2576 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( |
2577 base::Bind(&media::MessageLoopFactory::GetMessageLoop, | 2577 base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
2578 base::Unretained(message_loop_factory), | 2578 base::Unretained(message_loop_factory), |
2579 media::MessageLoopFactory::kDecoder), | 2579 media::MessageLoopFactory::kDecoder), |
2580 factories_loop, | 2580 factories_loop, |
2581 new RendererGpuVideoDecoderFactories( | 2581 new RendererGpuVideoDecoderFactories( |
2582 gpu_channel_host, factories_loop, context3d))); | 2582 gpu_channel_host, factories_loop, context3d))); |
2583 } | 2583 } |
2584 | 2584 |
2585 WebMediaPlayer* media_player = | 2585 WebMediaPlayer* media_player = |
2586 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2586 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
2587 this, frame, client, AsWeakPtr(), collection, audio_source_provider, | 2587 this, frame, client, AsWeakPtr(), collection, audio_source_provider, |
2588 audio_source_provider, message_loop_factory, media_stream_impl_, | 2588 audio_source_provider, message_loop_factory, media_stream_impl_, |
2589 render_media_log); | 2589 render_media_log); |
2590 if (!media_player) { | 2590 if (!media_player) { |
| 2591 // TODO(wjia): when all patches related to WebMediaPlayerMS have been |
| 2592 // landed, remove the switch. Refer to crbug.com/142988. |
| 2593 if (cmd_line->HasSwitch(switches::kEnableWebMediaPlayerMS)) { |
| 2594 EnsureMediaStreamImpl(); |
| 2595 if (media_stream_impl_ && media_stream_impl_->IsMediaStream(url)) { |
| 2596 return new webkit_media::WebMediaPlayerMS( |
| 2597 frame, client, AsWeakPtr(), media_stream_impl_, render_media_log); |
| 2598 } |
| 2599 } |
| 2600 |
2591 media_player = new webkit_media::WebMediaPlayerImpl( | 2601 media_player = new webkit_media::WebMediaPlayerImpl( |
2592 frame, client, AsWeakPtr(), collection, audio_source_provider, | 2602 frame, client, AsWeakPtr(), collection, audio_source_provider, |
2593 audio_source_provider, message_loop_factory, media_stream_impl_, | 2603 audio_source_provider, message_loop_factory, media_stream_impl_, |
2594 render_media_log); | 2604 render_media_log); |
2595 } | 2605 } |
2596 return media_player; | 2606 return media_player; |
2597 } | 2607 } |
2598 | 2608 |
2599 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2609 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
2600 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2610 WebFrame* frame, WebApplicationCacheHostClient* client) { |
(...skipping 3659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6260 | 6270 |
6261 updating_frame_tree_ = true; | 6271 updating_frame_tree_ = true; |
6262 active_frame_id_map_.clear(); | 6272 active_frame_id_map_.clear(); |
6263 | 6273 |
6264 target_process_id_ = process_id; | 6274 target_process_id_ = process_id; |
6265 target_routing_id_ = route_id; | 6275 target_routing_id_ = route_id; |
6266 CreateFrameTree(webview()->mainFrame(), frames); | 6276 CreateFrameTree(webview()->mainFrame(), frames); |
6267 | 6277 |
6268 updating_frame_tree_ = false; | 6278 updating_frame_tree_ = false; |
6269 } | 6279 } |
OLD | NEW |