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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3579 | 3579 |
3580 blink::WebUserMediaClient* RenderFrameImpl::userMediaClient() { | 3580 blink::WebUserMediaClient* RenderFrameImpl::userMediaClient() { |
3581 if (!web_user_media_client_) | 3581 if (!web_user_media_client_) |
3582 InitializeUserMediaClient(); | 3582 InitializeUserMediaClient(); |
3583 return web_user_media_client_; | 3583 return web_user_media_client_; |
3584 } | 3584 } |
3585 | 3585 |
3586 blink::WebEncryptedMediaClient* RenderFrameImpl::encryptedMediaClient() { | 3586 blink::WebEncryptedMediaClient* RenderFrameImpl::encryptedMediaClient() { |
3587 if (!web_encrypted_media_client_) { | 3587 if (!web_encrypted_media_client_) { |
3588 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( | 3588 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( |
3589 base::Bind(&RenderFrameImpl::AreSecureCodecsSupported, | |
3590 base::Unretained(this)), | |
nasko
2015/05/08 22:17:23
nit: Put a comment explaining why using base::Unre
sandersd (OOO until July 31)
2015/05/08 22:29:37
Done.
| |
3589 GetCdmFactory(), GetMediaPermission())); | 3591 GetCdmFactory(), GetMediaPermission())); |
3590 } | 3592 } |
3591 return web_encrypted_media_client_.get(); | 3593 return web_encrypted_media_client_.get(); |
3592 } | 3594 } |
3593 | 3595 |
3594 blink::WebMIDIClient* RenderFrameImpl::webMIDIClient() { | 3596 blink::WebMIDIClient* RenderFrameImpl::webMIDIClient() { |
3595 if (!midi_dispatcher_) | 3597 if (!midi_dispatcher_) |
3596 midi_dispatcher_ = new MidiDispatcher(this); | 3598 midi_dispatcher_ = new MidiDispatcher(this); |
3597 return midi_dispatcher_; | 3599 return midi_dispatcher_; |
3598 } | 3600 } |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4911 } | 4913 } |
4912 | 4914 |
4913 #endif // defined(OS_ANDROID) | 4915 #endif // defined(OS_ANDROID) |
4914 | 4916 |
4915 media::MediaPermission* RenderFrameImpl::GetMediaPermission() { | 4917 media::MediaPermission* RenderFrameImpl::GetMediaPermission() { |
4916 if (!media_permission_dispatcher_) | 4918 if (!media_permission_dispatcher_) |
4917 media_permission_dispatcher_ = new MediaPermissionDispatcher(this); | 4919 media_permission_dispatcher_ = new MediaPermissionDispatcher(this); |
4918 return media_permission_dispatcher_; | 4920 return media_permission_dispatcher_; |
4919 } | 4921 } |
4920 | 4922 |
4923 bool RenderFrameImpl::AreSecureCodecsSupported() { | |
4924 #if defined(OS_ANDROID) | |
4925 // Hardware-secure codecs are only supported if secure surfaces are enabled. | |
4926 content::RendererPreferences& renderer_preferences = | |
4927 render_view_->renderer_preferences(); | |
4928 return renderer_prefences.use_video_overlay_for_embedded_encrypted_video; | |
4929 #else | |
4930 return false; | |
4931 #endif // defined(OS_ANDROID) | |
4932 } | |
4933 | |
4921 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { | 4934 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { |
4922 #if defined(ENABLE_BROWSER_CDMS) | 4935 #if defined(ENABLE_BROWSER_CDMS) |
4923 if (!cdm_manager_) | 4936 if (!cdm_manager_) |
4924 cdm_manager_ = new RendererCdmManager(this); | 4937 cdm_manager_ = new RendererCdmManager(this); |
4925 #endif // defined(ENABLE_BROWSER_CDMS) | 4938 #endif // defined(ENABLE_BROWSER_CDMS) |
4926 | 4939 |
4927 if (!cdm_factory_) { | 4940 if (!cdm_factory_) { |
4928 DCHECK(frame_); | 4941 DCHECK(frame_); |
4929 cdm_factory_ = new RenderCdmFactory( | 4942 cdm_factory_ = new RenderCdmFactory( |
4930 #if defined(ENABLE_PEPPER_CDMS) | 4943 #if defined(ENABLE_PEPPER_CDMS) |
4931 base::Bind(&PepperCdmWrapperImpl::Create, frame_), | 4944 base::Bind(&PepperCdmWrapperImpl::Create, frame_), |
4932 #elif defined(ENABLE_BROWSER_CDMS) | 4945 #elif defined(ENABLE_BROWSER_CDMS) |
4933 cdm_manager_, | 4946 cdm_manager_, |
4934 #endif | 4947 #endif |
4935 this); | 4948 this); |
4936 } | 4949 } |
4937 | 4950 |
4938 return cdm_factory_; | 4951 return cdm_factory_; |
4939 } | 4952 } |
4940 | 4953 |
4941 } // namespace content | 4954 } // namespace content |
OLD | NEW |