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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2489 audio_source_provider = new RenderAudioSourceProvider(); | 2490 audio_source_provider = new RenderAudioSourceProvider(); |
2490 | 2491 |
2491 // Add the chrome specific audio renderer, using audio_source_provider | 2492 // Add the chrome specific audio renderer, using audio_source_provider |
2492 // as the sink. | 2493 // as the sink. |
2493 media::AudioRendererImpl* audio_renderer = | 2494 media::AudioRendererImpl* audio_renderer = |
2494 new media::AudioRendererImpl(audio_source_provider); | 2495 new media::AudioRendererImpl(audio_source_provider); |
2495 collection->AddAudioRenderer(audio_renderer); | 2496 collection->AddAudioRenderer(audio_renderer); |
2496 } | 2497 } |
2497 | 2498 |
2498 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | 2499 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; |
2499 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 2500 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
scherkus (not reviewing)
2012/09/20 19:27:00
nit: can you switch this to use cmd_line?
wjia(left Chromium)
2012/09/21 19:47:27
Done.
| |
2500 switches::kDisableAcceleratedVideoDecode)) | 2501 switches::kDisableAcceleratedVideoDecode)) |
2501 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); | 2502 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); |
2502 if (context3d) { | 2503 if (context3d) { |
2503 scoped_refptr<base::MessageLoopProxy> factories_loop = | 2504 scoped_refptr<base::MessageLoopProxy> factories_loop = |
2504 RenderThreadImpl::current()->compositor_thread() ? | 2505 RenderThreadImpl::current()->compositor_thread() ? |
2505 RenderThreadImpl::current()->compositor_thread()->GetWebThread() | 2506 RenderThreadImpl::current()->compositor_thread()->GetWebThread() |
2506 ->message_loop()->message_loop_proxy() : | 2507 ->message_loop()->message_loop_proxy() : |
2507 base::MessageLoopProxy::current(); | 2508 base::MessageLoopProxy::current(); |
2508 GpuChannelHost* gpu_channel_host = | 2509 GpuChannelHost* gpu_channel_host = |
2509 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2510 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2510 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2511 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2511 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( | 2512 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( |
2512 base::Bind(&media::MessageLoopFactory::GetMessageLoop, | 2513 base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
2513 base::Unretained(message_loop_factory), | 2514 base::Unretained(message_loop_factory), |
2514 media::MessageLoopFactory::kDecoder), | 2515 media::MessageLoopFactory::kDecoder), |
2515 factories_loop, | 2516 factories_loop, |
2516 new RendererGpuVideoDecoderFactories( | 2517 new RendererGpuVideoDecoderFactories( |
2517 gpu_channel_host, factories_loop, context3d))); | 2518 gpu_channel_host, factories_loop, context3d))); |
2518 } | 2519 } |
2519 | 2520 |
2520 WebMediaPlayer* media_player = | 2521 WebMediaPlayer* media_player = |
2521 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 2522 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
2522 this, frame, client, AsWeakPtr(), collection, audio_source_provider, | 2523 this, frame, client, AsWeakPtr(), collection, audio_source_provider, |
2523 audio_source_provider, message_loop_factory, media_stream_impl_, | 2524 audio_source_provider, message_loop_factory, media_stream_impl_, |
2524 render_media_log); | 2525 render_media_log); |
2525 if (!media_player) { | 2526 if (!media_player) { |
2527 EnsureMediaStreamImpl(); | |
2528 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | |
scherkus (not reviewing)
2012/09/20 19:27:00
nit: this is already declared at line 2486
wjia(left Chromium)
2012/09/21 19:47:27
Done.
| |
2529 if (cmd_line->HasSwitch(switches::kEnableMediaPlayerSwitch) && | |
2530 media_stream_impl_ && media_stream_impl_->IsMediaStream(url)) { | |
2531 // TODO(wjia): when all patches related to WebMediaPlayerMS have been | |
scherkus (not reviewing)
2012/09/20 19:27:00
indent looks wrong here
wjia(left Chromium)
2012/09/21 19:47:27
Done.
| |
2532 // landed, remove the switch. Refer to crbug.com/142988. | |
2533 return new webkit_media::WebMediaPlayerMS( | |
2534 frame, client, AsWeakPtr(), media_stream_impl_, render_media_log); | |
2535 } | |
2536 | |
2526 media_player = new webkit_media::WebMediaPlayerImpl( | 2537 media_player = new webkit_media::WebMediaPlayerImpl( |
2527 frame, client, AsWeakPtr(), collection, audio_source_provider, | 2538 frame, client, AsWeakPtr(), collection, audio_source_provider, |
2528 audio_source_provider, message_loop_factory, media_stream_impl_, | 2539 audio_source_provider, message_loop_factory, media_stream_impl_, |
2529 render_media_log); | 2540 render_media_log); |
2530 } | 2541 } |
2531 return media_player; | 2542 return media_player; |
2532 } | 2543 } |
2533 | 2544 |
2534 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 2545 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
2535 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2546 WebFrame* frame, WebApplicationCacheHostClient* client) { |
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6119 | 6130 |
6120 updating_frame_tree_ = true; | 6131 updating_frame_tree_ = true; |
6121 active_frame_id_map_.clear(); | 6132 active_frame_id_map_.clear(); |
6122 | 6133 |
6123 target_process_id_ = process_id; | 6134 target_process_id_ = process_id; |
6124 target_routing_id_ = route_id; | 6135 target_routing_id_ = route_id; |
6125 CreateFrameTree(webview()->mainFrame(), frames); | 6136 CreateFrameTree(webview()->mainFrame(), frames); |
6126 | 6137 |
6127 updating_frame_tree_ = false; | 6138 updating_frame_tree_ = false; |
6128 } | 6139 } |
OLD | NEW |