Chromium Code Reviews| 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 6757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6768 | 6768 |
| 6769 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) | 6769 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) |
| 6770 media::mojom::RemoterFactory* RenderFrameImpl::GetRemoterFactory() { | 6770 media::mojom::RemoterFactory* RenderFrameImpl::GetRemoterFactory() { |
| 6771 if (!remoter_factory_) | 6771 if (!remoter_factory_) |
| 6772 GetRemoteInterfaces()->GetInterface(&remoter_factory_); | 6772 GetRemoteInterfaces()->GetInterface(&remoter_factory_); |
| 6773 return remoter_factory_.get(); | 6773 return remoter_factory_.get(); |
| 6774 } | 6774 } |
| 6775 #endif | 6775 #endif |
| 6776 | 6776 |
| 6777 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { | 6777 media::CdmFactory* RenderFrameImpl::GetCdmFactory() { |
| 6778 DCHECK(frame_); | |
| 6779 | |
| 6778 if (cdm_factory_) | 6780 if (cdm_factory_) |
| 6779 return cdm_factory_.get(); | 6781 return cdm_factory_.get(); |
| 6780 | 6782 |
| 6781 #if BUILDFLAG(ENABLE_MOJO_CDM) | 6783 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
| 6784 static_assert(BUILDFLAG(ENABLE_MOJO_CDM), | |
| 6785 "Mojo CDM should always be enabled when PPAPI CDM is enabled"); | |
| 6786 if (base::FeatureList::IsEnabled(media::kMojoCdm)) | |
| 6787 cdm_factory_.reset(new media::MojoCdmFactory(GetMediaInterfaceProvider())); | |
| 6788 else | |
|
jam
2017/05/24 00:36:33
nit: brace brackets per style guide
| |
| 6789 cdm_factory_.reset(new RenderCdmFactory( | |
| 6790 base::Bind(&PepperCdmWrapperImpl::Create, frame_))); | |
| 6791 #elif BUILDFLAG(ENABLE_MOJO_CDM) | |
| 6782 cdm_factory_.reset(new media::MojoCdmFactory(GetMediaInterfaceProvider())); | 6792 cdm_factory_.reset(new media::MojoCdmFactory(GetMediaInterfaceProvider())); |
| 6783 return cdm_factory_.get(); | |
| 6784 #endif // BUILDFLAG(ENABLE_MOJO_CDM) | |
| 6785 | |
| 6786 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | |
| 6787 DCHECK(frame_); | |
| 6788 cdm_factory_.reset( | |
| 6789 new RenderCdmFactory(base::Bind(&PepperCdmWrapperImpl::Create, frame_))); | |
| 6790 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | 6793 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
| 6791 | 6794 |
| 6792 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) | 6795 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) |
|
jrummell
2017/05/23 22:23:28
Is it possible for cdm_factory_ to get set twice?
xhwang
2017/05/23 22:31:12
The RemotingCdmFactory actually wraps the cdm_fact
| |
| 6793 cdm_factory_.reset(new media::remoting::RemotingCdmFactory( | 6796 cdm_factory_.reset(new media::remoting::RemotingCdmFactory( |
| 6794 std::move(cdm_factory_), GetRemoterFactory(), | 6797 std::move(cdm_factory_), GetRemoterFactory(), |
| 6795 std::move(remoting_sink_observer_))); | 6798 std::move(remoting_sink_observer_))); |
| 6796 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 6799 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) |
| 6797 | 6800 |
| 6798 return cdm_factory_.get(); | 6801 return cdm_factory_.get(); |
| 6799 } | 6802 } |
| 6800 | 6803 |
| 6801 media::DecoderFactory* RenderFrameImpl::GetDecoderFactory() { | 6804 media::DecoderFactory* RenderFrameImpl::GetDecoderFactory() { |
| 6802 #if BUILDFLAG(ENABLE_MOJO_AUDIO_DECODER) || BUILDFLAG(ENABLE_MOJO_VIDEO_DECODER) | 6805 #if BUILDFLAG(ENABLE_MOJO_AUDIO_DECODER) || BUILDFLAG(ENABLE_MOJO_VIDEO_DECODER) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7074 policy(info.default_policy), | 7077 policy(info.default_policy), |
| 7075 replaces_current_history_item(info.replaces_current_history_item), | 7078 replaces_current_history_item(info.replaces_current_history_item), |
| 7076 history_navigation_in_new_child_frame( | 7079 history_navigation_in_new_child_frame( |
| 7077 info.is_history_navigation_in_new_child_frame), | 7080 info.is_history_navigation_in_new_child_frame), |
| 7078 client_redirect(info.is_client_redirect), | 7081 client_redirect(info.is_client_redirect), |
| 7079 cache_disabled(info.is_cache_disabled), | 7082 cache_disabled(info.is_cache_disabled), |
| 7080 form(info.form), | 7083 form(info.form), |
| 7081 source_location(info.source_location) {} | 7084 source_location(info.source_location) {} |
| 7082 | 7085 |
| 7083 } // namespace content | 7086 } // namespace content |
| OLD | NEW |