| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #include "content/renderer/internal_document_state_data.h" | 96 #include "content/renderer/internal_document_state_data.h" |
| 97 #include "content/renderer/manifest/manifest_manager.h" | 97 #include "content/renderer/manifest/manifest_manager.h" |
| 98 #include "content/renderer/media/audio_device_factory.h" | 98 #include "content/renderer/media/audio_device_factory.h" |
| 99 #include "content/renderer/media/media_permission_dispatcher.h" | 99 #include "content/renderer/media/media_permission_dispatcher.h" |
| 100 #include "content/renderer/media/media_stream_dispatcher.h" | 100 #include "content/renderer/media/media_stream_dispatcher.h" |
| 101 #include "content/renderer/media/media_stream_renderer_factory_impl.h" | 101 #include "content/renderer/media/media_stream_renderer_factory_impl.h" |
| 102 #include "content/renderer/media/midi_dispatcher.h" | 102 #include "content/renderer/media/midi_dispatcher.h" |
| 103 #include "content/renderer/media/render_media_log.h" | 103 #include "content/renderer/media/render_media_log.h" |
| 104 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" | 104 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" |
| 105 #include "content/renderer/media/user_media_client_impl.h" | 105 #include "content/renderer/media/user_media_client_impl.h" |
| 106 #include "content/renderer/media/web_media_element_source_utils.h" |
| 106 #include "content/renderer/media/webmediaplayer_ms.h" | 107 #include "content/renderer/media/webmediaplayer_ms.h" |
| 107 #include "content/renderer/mojo/service_registry_js_wrapper.h" | 108 #include "content/renderer/mojo/service_registry_js_wrapper.h" |
| 108 #include "content/renderer/mojo_bindings_controller.h" | 109 #include "content/renderer/mojo_bindings_controller.h" |
| 109 #include "content/renderer/navigation_state_impl.h" | 110 #include "content/renderer/navigation_state_impl.h" |
| 110 #include "content/renderer/notification_permission_dispatcher.h" | 111 #include "content/renderer/notification_permission_dispatcher.h" |
| 111 #include "content/renderer/npapi/plugin_channel_host.h" | 112 #include "content/renderer/npapi/plugin_channel_host.h" |
| 112 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" | 113 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
| 113 #include "content/renderer/presentation/presentation_dispatcher.h" | 114 #include "content/renderer/presentation/presentation_dispatcher.h" |
| 114 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" | 115 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" |
| 115 #include "content/renderer/render_frame_proxy.h" | 116 #include "content/renderer/render_frame_proxy.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 143 #include "media/renderers/gpu_video_accelerator_factories.h" | 144 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 144 #include "mojo/common/url_type_converters.h" | 145 #include "mojo/common/url_type_converters.h" |
| 145 #include "mojo/edk/js/core.h" | 146 #include "mojo/edk/js/core.h" |
| 146 #include "mojo/edk/js/support.h" | 147 #include "mojo/edk/js/support.h" |
| 147 #include "net/base/data_url.h" | 148 #include "net/base/data_url.h" |
| 148 #include "net/base/net_errors.h" | 149 #include "net/base/net_errors.h" |
| 149 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 150 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 150 #include "net/http/http_util.h" | 151 #include "net/http/http_util.h" |
| 151 #include "third_party/WebKit/public/platform/URLConversion.h" | 152 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 152 #include "third_party/WebKit/public/platform/WebData.h" | 153 #include "third_party/WebKit/public/platform/WebData.h" |
| 154 #include "third_party/WebKit/public/platform/WebMediaElementSource.h" |
| 153 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 155 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
| 154 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 156 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 155 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 157 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
| 156 #include "third_party/WebKit/public/platform/WebString.h" | 158 #include "third_party/WebKit/public/platform/WebString.h" |
| 157 #include "third_party/WebKit/public/platform/WebURL.h" | 159 #include "third_party/WebKit/public/platform/WebURL.h" |
| 158 #include "third_party/WebKit/public/platform/WebURLError.h" | 160 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 159 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 161 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 160 #include "third_party/WebKit/public/platform/WebVector.h" | 162 #include "third_party/WebKit/public/platform/WebVector.h" |
| 161 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" | 163 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" |
| 162 #include "third_party/WebKit/public/web/WebColorSuggestion.h" | 164 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
| (...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2401 | 2403 |
| 2402 WebPluginParams params_to_use = params; | 2404 WebPluginParams params_to_use = params; |
| 2403 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2405 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
| 2404 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */); | 2406 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */); |
| 2405 #else | 2407 #else |
| 2406 return NULL; | 2408 return NULL; |
| 2407 #endif // defined(ENABLE_PLUGINS) | 2409 #endif // defined(ENABLE_PLUGINS) |
| 2408 } | 2410 } |
| 2409 | 2411 |
| 2410 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( | 2412 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( |
| 2411 const blink::WebURL& url, | 2413 const blink::WebMediaElementSource& source, |
| 2412 WebMediaPlayerClient* client, | 2414 WebMediaPlayerClient* client, |
| 2413 WebMediaPlayerEncryptedMediaClient* encrypted_client, | 2415 WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 2414 WebContentDecryptionModule* initial_cdm, | 2416 WebContentDecryptionModule* initial_cdm, |
| 2415 const blink::WebString& sink_id, | 2417 const blink::WebString& sink_id, |
| 2416 WebMediaSession* media_session) { | 2418 WebMediaSession* media_session) { |
| 2417 #if defined(VIDEO_HOLE) | 2419 #if defined(VIDEO_HOLE) |
| 2418 if (!contains_media_player_) { | 2420 if (!contains_media_player_) { |
| 2419 render_view_->RegisterVideoHoleFrame(this); | 2421 render_view_->RegisterVideoHoleFrame(this); |
| 2420 contains_media_player_ = true; | 2422 contains_media_player_ = true; |
| 2421 } | 2423 } |
| 2422 #endif // defined(VIDEO_HOLE) | 2424 #endif // defined(VIDEO_HOLE) |
| 2423 | 2425 blink::WebMediaStream web_stream = |
| 2424 blink::WebMediaStream web_stream( | 2426 GetWebMediaStreamFromWebMediaElementSource(source); |
| 2425 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); | |
| 2426 if (!web_stream.isNull()) | 2427 if (!web_stream.isNull()) |
| 2427 return CreateWebMediaPlayerForMediaStream(client, sink_id, | 2428 return CreateWebMediaPlayerForMediaStream(client, sink_id, |
| 2428 frame_->getSecurityOrigin()); | 2429 frame_->getSecurityOrigin()); |
| 2429 | 2430 |
| 2431 // If |source| was not a MediaStream, it must be a URL. |
| 2432 // TODO(guidou): Fix this when support for other srcObject types is added. |
| 2433 DCHECK(source.isURL()); |
| 2434 blink::WebURL url = source.getAsURL(); |
| 2435 |
| 2430 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 2436 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 2431 | 2437 |
| 2432 scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink = | 2438 scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink = |
| 2433 AudioDeviceFactory::NewSwitchableAudioRendererSink( | 2439 AudioDeviceFactory::NewSwitchableAudioRendererSink( |
| 2434 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, | 2440 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, |
| 2435 sink_id.utf8(), frame_->getSecurityOrigin()); | 2441 sink_id.utf8(), frame_->getSecurityOrigin()); |
| 2436 media::WebMediaPlayerParams::Context3DCB context_3d_cb = | 2442 media::WebMediaPlayerParams::Context3DCB context_3d_cb = |
| 2437 base::Bind(&GetSharedMainThreadContext3D); | 2443 base::Bind(&GetSharedMainThreadContext3D); |
| 2438 | 2444 |
| 2439 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); | 2445 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); |
| (...skipping 3592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6032 int match_count, | 6038 int match_count, |
| 6033 int ordinal, | 6039 int ordinal, |
| 6034 const WebRect& selection_rect, | 6040 const WebRect& selection_rect, |
| 6035 bool final_status_update) { | 6041 bool final_status_update) { |
| 6036 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6042 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6037 selection_rect, ordinal, | 6043 selection_rect, ordinal, |
| 6038 final_status_update)); | 6044 final_status_update)); |
| 6039 } | 6045 } |
| 6040 | 6046 |
| 6041 } // namespace content | 6047 } // namespace content |
| OLD | NEW |