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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 routing_id_)); | 2823 routing_id_)); |
2824 | 2824 |
2825 #if BUILDFLAG(ENABLE_VR) | 2825 #if BUILDFLAG(ENABLE_VR) |
2826 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2826 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
2827 base::Bind(&device::VRServiceImpl::Create)); | 2827 base::Bind(&device::VRServiceImpl::Create)); |
2828 #else | 2828 #else |
2829 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2829 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
2830 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); | 2830 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); |
2831 #endif | 2831 #endif |
2832 | 2832 |
| 2833 if (RendererAudioOutputStreamFactoryContextImpl::UseMojoFactories()) { |
| 2834 GetInterfaceRegistry()->AddInterface(base::BindRepeating( |
| 2835 &RenderFrameHostImpl::CreateAudioOutputStreamFactory, |
| 2836 base::Unretained(this))); |
| 2837 } |
| 2838 |
2833 #if BUILDFLAG(ENABLE_WEBRTC) | 2839 #if BUILDFLAG(ENABLE_WEBRTC) |
2834 // BrowserMainLoop::GetInstance() may be null on unit tests. | 2840 // BrowserMainLoop::GetInstance() may be null on unit tests. |
2835 if (BrowserMainLoop::GetInstance()) { | 2841 if (BrowserMainLoop::GetInstance()) { |
2836 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime | 2842 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime |
2837 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | 2843 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), |
2838 // which shuts down Mojo). Hence, passing that MediaStreamManager instance | 2844 // which shuts down Mojo). Hence, passing that MediaStreamManager instance |
2839 // as a raw pointer here is safe. | 2845 // as a raw pointer here is safe. |
2840 MediaStreamManager* media_stream_manager = | 2846 MediaStreamManager* media_stream_manager = |
2841 BrowserMainLoop::GetInstance()->media_stream_manager(); | 2847 BrowserMainLoop::GetInstance()->media_stream_manager(); |
2842 GetInterfaceRegistry()->AddInterface( | 2848 GetInterfaceRegistry()->AddInterface( |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3822 void RenderFrameHostImpl::ResetFeaturePolicy() { | 3828 void RenderFrameHostImpl::ResetFeaturePolicy() { |
3823 RenderFrameHostImpl* parent_frame_host = GetParent(); | 3829 RenderFrameHostImpl* parent_frame_host = GetParent(); |
3824 const FeaturePolicy* parent_policy = | 3830 const FeaturePolicy* parent_policy = |
3825 parent_frame_host ? parent_frame_host->feature_policy() : nullptr; | 3831 parent_frame_host ? parent_frame_host->feature_policy() : nullptr; |
3826 ParsedFeaturePolicyHeader container_policy = | 3832 ParsedFeaturePolicyHeader container_policy = |
3827 frame_tree_node()->effective_container_policy(); | 3833 frame_tree_node()->effective_container_policy(); |
3828 feature_policy_ = FeaturePolicy::CreateFromParentPolicy( | 3834 feature_policy_ = FeaturePolicy::CreateFromParentPolicy( |
3829 parent_policy, container_policy, last_committed_origin_); | 3835 parent_policy, container_policy, last_committed_origin_); |
3830 } | 3836 } |
3831 | 3837 |
| 3838 void RenderFrameHostImpl::CreateAudioOutputStreamFactory( |
| 3839 const service_manager::BindSourceInfo& source_info, |
| 3840 mojom::RendererAudioOutputStreamFactoryRequest request) { |
| 3841 RenderProcessHostImpl* process = |
| 3842 static_cast<RenderProcessHostImpl*>(GetProcess()); |
| 3843 audio_output_stream_factory_ = process->CreateAudioOutputStreamFactory( |
| 3844 GetRoutingID(), std::move(request)); |
| 3845 } |
| 3846 |
3832 void RenderFrameHostImpl::BindMediaInterfaceFactoryRequest( | 3847 void RenderFrameHostImpl::BindMediaInterfaceFactoryRequest( |
3833 const service_manager::BindSourceInfo& source_info, | 3848 const service_manager::BindSourceInfo& source_info, |
3834 media::mojom::InterfaceFactoryRequest request) { | 3849 media::mojom::InterfaceFactoryRequest request) { |
3835 DCHECK(!media_interface_proxy_); | 3850 DCHECK(!media_interface_proxy_); |
3836 media_interface_proxy_.reset(new MediaInterfaceProxy( | 3851 media_interface_proxy_.reset(new MediaInterfaceProxy( |
3837 this, std::move(request), | 3852 this, std::move(request), |
3838 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError, | 3853 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError, |
3839 base::Unretained(this)))); | 3854 base::Unretained(this)))); |
3840 } | 3855 } |
3841 | 3856 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4065 } | 4080 } |
4066 | 4081 |
4067 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( | 4082 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( |
4068 const std::string& interface_name, | 4083 const std::string& interface_name, |
4069 mojo::ScopedMessagePipeHandle pipe) { | 4084 mojo::ScopedMessagePipeHandle pipe) { |
4070 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); | 4085 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); |
4071 } | 4086 } |
4072 #endif | 4087 #endif |
4073 | 4088 |
4074 } // namespace content | 4089 } // namespace content |
OLD | NEW |