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

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

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wolenetz comments Created 4 years, 8 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
OLDNEW
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
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/npapi/plugin_channel_host.h" 111 #include "content/renderer/npapi/plugin_channel_host.h"
111 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" 112 #include "content/renderer/pepper/plugin_instance_throttler_impl.h"
112 #include "content/renderer/presentation/presentation_dispatcher.h" 113 #include "content/renderer/presentation/presentation_dispatcher.h"
113 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" 114 #include "content/renderer/push_messaging/push_messaging_dispatcher.h"
114 #include "content/renderer/render_frame_proxy.h" 115 #include "content/renderer/render_frame_proxy.h"
(...skipping 27 matching lines...) Expand all
142 #include "media/renderers/gpu_video_accelerator_factories.h" 143 #include "media/renderers/gpu_video_accelerator_factories.h"
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"
153 #include "third_party/WebKit/public/platform/WebMediaElementSource.h"
152 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 154 #include "third_party/WebKit/public/platform/WebMediaPlayer.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"
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 WebPluginParams params_to_use = params; 2383 WebPluginParams params_to_use = params;
2382 params_to_use.mimeType = WebString::fromUTF8(mime_type); 2384 params_to_use.mimeType = WebString::fromUTF8(mime_type);
2383 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */); 2385 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */);
2384 #else 2386 #else
2385 return NULL; 2387 return NULL;
2386 #endif // defined(ENABLE_PLUGINS) 2388 #endif // defined(ENABLE_PLUGINS)
2387 } 2389 }
2388 2390
2389 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( 2391 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
2390 blink::WebMediaPlayer::LoadType load_type, 2392 blink::WebMediaPlayer::LoadType load_type,
2391 const blink::WebURL& url, 2393 const blink::WebMediaElementSource& source,
2392 WebMediaPlayerClient* client, 2394 WebMediaPlayerClient* client,
2393 WebMediaPlayerEncryptedMediaClient* encrypted_client, 2395 WebMediaPlayerEncryptedMediaClient* encrypted_client,
2394 WebContentDecryptionModule* initial_cdm, 2396 WebContentDecryptionModule* initial_cdm,
2395 const blink::WebString& sink_id, 2397 const blink::WebString& sink_id,
2396 WebMediaSession* media_session) { 2398 WebMediaSession* media_session) {
2397 #if defined(VIDEO_HOLE) 2399 #if defined(VIDEO_HOLE)
2398 if (!contains_media_player_) { 2400 if (!contains_media_player_) {
2399 render_view_->RegisterVideoHoleFrame(this); 2401 render_view_->RegisterVideoHoleFrame(this);
2400 contains_media_player_ = true; 2402 contains_media_player_ = true;
2401 } 2403 }
2402 #endif // defined(VIDEO_HOLE) 2404 #endif // defined(VIDEO_HOLE)
2403 2405 blink::WebMediaStream web_stream =
2404 blink::WebMediaStream web_stream( 2406 GetWebMediaStreamFromWebMediaElementSource(source);
2405 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
2406 if (!web_stream.isNull()) 2407 if (!web_stream.isNull())
2407 return CreateWebMediaPlayerForMediaStream(client, sink_id, 2408 return CreateWebMediaPlayerForMediaStream(client, sink_id,
2408 frame_->getSecurityOrigin()); 2409 frame_->getSecurityOrigin());
2409 2410
2411 // If |source| was not a MediaStream, it must be a URL.
2412 // TODO(guidou): Fix this when support for other srcObject types is added.
2413 DCHECK(source.isURL());
2414 blink::WebURL url = source.getAsURL();
2415
2410 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 2416 RenderThreadImpl* render_thread = RenderThreadImpl::current();
2411 2417
2412 scoped_refptr<media::RestartableAudioRendererSink> audio_renderer_sink = 2418 scoped_refptr<media::RestartableAudioRendererSink> audio_renderer_sink =
2413 AudioDeviceFactory::NewRestartableAudioRendererSink( 2419 AudioDeviceFactory::NewRestartableAudioRendererSink(
2414 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, 2420 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0,
2415 sink_id.utf8(), frame_->getSecurityOrigin()); 2421 sink_id.utf8(), frame_->getSecurityOrigin());
2416 media::WebMediaPlayerParams::Context3DCB context_3d_cb = 2422 media::WebMediaPlayerParams::Context3DCB context_3d_cb =
2417 base::Bind(&GetSharedMainThreadContext3D); 2423 base::Bind(&GetSharedMainThreadContext3D);
2418 2424
2419 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); 2425 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog());
(...skipping 3586 matching lines...) Expand 10 before | Expand all | Expand 10 after
6006 int match_count, 6012 int match_count,
6007 int ordinal, 6013 int ordinal,
6008 const WebRect& selection_rect, 6014 const WebRect& selection_rect,
6009 bool final_status_update) { 6015 bool final_status_update) {
6010 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6016 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6011 selection_rect, ordinal, 6017 selection_rect, ordinal,
6012 final_status_update)); 6018 final_status_update));
6013 } 6019 }
6014 6020
6015 } // namespace content 6021 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698