| 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::Unretained(this) is safe because WebEncryptedMediaClientImpl |
| 3590 // is destructed before |this|, and does not give away ownership of the |
| 3591 // callback. |
| 3592 base::Bind(&RenderFrameImpl::AreSecureCodecsSupported, |
| 3593 base::Unretained(this)), |
| 3589 GetCdmFactory(), GetMediaPermission())); | 3594 GetCdmFactory(), GetMediaPermission())); |
| 3590 } | 3595 } |
| 3591 return web_encrypted_media_client_.get(); | 3596 return web_encrypted_media_client_.get(); |
| 3592 } | 3597 } |
| 3593 | 3598 |
| 3594 blink::WebMIDIClient* RenderFrameImpl::webMIDIClient() { | 3599 blink::WebMIDIClient* RenderFrameImpl::webMIDIClient() { |
| 3595 if (!midi_dispatcher_) | 3600 if (!midi_dispatcher_) |
| 3596 midi_dispatcher_ = new MidiDispatcher(this); | 3601 midi_dispatcher_ = new MidiDispatcher(this); |
| 3597 return midi_dispatcher_; | 3602 return midi_dispatcher_; |
| 3598 } | 3603 } |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4911 } | 4916 } |
| 4912 | 4917 |
| 4913 #endif // defined(OS_ANDROID) | 4918 #endif // defined(OS_ANDROID) |
| 4914 | 4919 |
| 4915 media::MediaPermission* RenderFrameImpl::GetMediaPermission() { | 4920 media::MediaPermission* RenderFrameImpl::GetMediaPermission() { |
| 4916 if (!media_permission_dispatcher_) | 4921 if (!media_permission_dispatcher_) |
| 4917 media_permission_dispatcher_ = new MediaPermissionDispatcher(this); | 4922 media_permission_dispatcher_ = new MediaPermissionDispatcher(this); |
| 4918 return media_permission_dispatcher_; | 4923 return media_permission_dispatcher_; |
| 4919 } | 4924 } |
| 4920 | 4925 |
| 4926 bool RenderFrameImpl::AreSecureCodecsSupported() { |
| 4927 #if defined(OS_ANDROID) |
| 4928 // Hardware-secure codecs are only supported if secure surfaces are enabled. |
| 4929 return render_view_->renderer_preferences_ |
| 4930 .use_video_overlay_for_embedded_encrypted_video; |
| 4931 #else |
| 4932 return false; |
| 4933 #endif // defined(OS_ANDROID) |
| 4934 } |
| 4935 |
| 4921 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { | 4936 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { |
| 4922 #if defined(ENABLE_BROWSER_CDMS) | 4937 #if defined(ENABLE_BROWSER_CDMS) |
| 4923 if (!cdm_manager_) | 4938 if (!cdm_manager_) |
| 4924 cdm_manager_ = new RendererCdmManager(this); | 4939 cdm_manager_ = new RendererCdmManager(this); |
| 4925 #endif // defined(ENABLE_BROWSER_CDMS) | 4940 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4926 | 4941 |
| 4927 if (!cdm_factory_) { | 4942 if (!cdm_factory_) { |
| 4928 DCHECK(frame_); | 4943 DCHECK(frame_); |
| 4929 cdm_factory_ = new RenderCdmFactory( | 4944 cdm_factory_ = new RenderCdmFactory( |
| 4930 #if defined(ENABLE_PEPPER_CDMS) | 4945 #if defined(ENABLE_PEPPER_CDMS) |
| 4931 base::Bind(&PepperCdmWrapperImpl::Create, frame_), | 4946 base::Bind(&PepperCdmWrapperImpl::Create, frame_), |
| 4932 #elif defined(ENABLE_BROWSER_CDMS) | 4947 #elif defined(ENABLE_BROWSER_CDMS) |
| 4933 cdm_manager_, | 4948 cdm_manager_, |
| 4934 #endif | 4949 #endif |
| 4935 this); | 4950 this); |
| 4936 } | 4951 } |
| 4937 | 4952 |
| 4938 return cdm_factory_; | 4953 return cdm_factory_; |
| 4939 } | 4954 } |
| 4940 | 4955 |
| 4941 } // namespace content | 4956 } // namespace content |
| OLD | NEW |