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