Commit 5aab1d1b authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Replace uses blink::Platform::CreateWebRtcAsyncResolverFactory

... by its PeerConnectionDependencyFactory counterpart.

This is now possible after [1], where
peer_connection_dependency_factory.cc|h is moved to Blink.

The CL also removes blink::Platform::CreateWebRtcPortAllocator()
and its overrides altogether. They are not called anymore.

[1] https://crrev.com/c/1805159

BUG=787254
R=guidou@chromium.org, haraken@chromium.org

Change-Id: Iff2967c958165e21e092bbeb617475c31239f060
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806847
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#708942}
parent 2e854975
...@@ -562,23 +562,6 @@ RendererBlinkPlatformImpl::GetWebRtcWorkerThread() { ...@@ -562,23 +562,6 @@ RendererBlinkPlatformImpl::GetWebRtcWorkerThread() {
return rtc_dependency_factory->GetWebRtcWorkerThread(); return rtc_dependency_factory->GetWebRtcWorkerThread();
} }
std::unique_ptr<cricket::PortAllocator>
RendererBlinkPlatformImpl::CreateWebRtcPortAllocator(
blink::WebLocalFrame* frame) {
auto* rtc_dependency_factory =
blink::PeerConnectionDependencyFactory::GetInstance();
rtc_dependency_factory->EnsureInitialized();
return rtc_dependency_factory->CreatePortAllocator(frame);
}
std::unique_ptr<webrtc::AsyncResolverFactory>
RendererBlinkPlatformImpl::CreateWebRtcAsyncResolverFactory() {
auto* rtc_dependency_factory =
blink::PeerConnectionDependencyFactory::GetInstance();
rtc_dependency_factory->EnsureInitialized();
return rtc_dependency_factory->CreateAsyncResolverFactory();
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
base::Optional<double> base::Optional<double>
......
...@@ -131,10 +131,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -131,10 +131,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebRTCPeerConnectionHandlerClient* client, blink::WebRTCPeerConnectionHandlerClient* client,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() override; scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() override;
std::unique_ptr<cricket::PortAllocator> CreateWebRtcPortAllocator(
blink::WebLocalFrame* frame) override;
std::unique_ptr<webrtc::AsyncResolverFactory>
CreateWebRtcAsyncResolverFactory() override;
base::Optional<double> GetWebRtcMaxCaptureFrameRate() override; base::Optional<double> GetWebRtcMaxCaptureFrameRate() override;
scoped_refptr<media::AudioRendererSink> NewAudioRendererSink( scoped_refptr<media::AudioRendererSink> NewAudioRendererSink(
blink::WebAudioDeviceSourceType source_type, blink::WebAudioDeviceSourceType source_type,
......
...@@ -72,10 +72,6 @@ namespace base { ...@@ -72,10 +72,6 @@ namespace base {
class SingleThreadTaskRunner; class SingleThreadTaskRunner;
} }
namespace cricket {
class PortAllocator;
}
namespace gpu { namespace gpu {
class GpuMemoryBufferManager; class GpuMemoryBufferManager;
} }
...@@ -101,10 +97,6 @@ namespace viz { ...@@ -101,10 +97,6 @@ namespace viz {
class ContextProvider; class ContextProvider;
} }
namespace webrtc {
class AsyncResolverFactory;
}
namespace blink { namespace blink {
class ThreadSafeBrowserInterfaceBrokerProxy; class ThreadSafeBrowserInterfaceBrokerProxy;
...@@ -576,14 +568,6 @@ class BLINK_PLATFORM_EXPORT Platform { ...@@ -576,14 +568,6 @@ class BLINK_PLATFORM_EXPORT Platform {
return nullptr; return nullptr;
} }
// May return null if WebRTC functionality is not implemented.
virtual std::unique_ptr<cricket::PortAllocator> CreateWebRtcPortAllocator(
WebLocalFrame* frame);
// May return null if WebRTC functionality is not implemented.
virtual std::unique_ptr<webrtc::AsyncResolverFactory>
CreateWebRtcAsyncResolverFactory();
// Checks if the default minimum starting volume value for the AGC is // Checks if the default minimum starting volume value for the AGC is
// overridden on the command line. // overridden on the command line.
virtual base::Optional<double> GetWebRtcMaxCaptureFrameRate() { virtual base::Optional<double> GetWebRtcMaxCaptureFrameRate() {
......
...@@ -364,6 +364,7 @@ std::unique_ptr<cricket::PortAllocator> ...@@ -364,6 +364,7 @@ std::unique_ptr<cricket::PortAllocator>
PeerConnectionDependencyFactory::CreatePortAllocator( PeerConnectionDependencyFactory::CreatePortAllocator(
blink::WebLocalFrame* web_frame) { blink::WebLocalFrame* web_frame) {
DCHECK(web_frame); DCHECK(web_frame);
EnsureInitialized();
// Copy the flag from Preference associated with this WebLocalFrame. // Copy the flag from Preference associated with this WebLocalFrame.
P2PPortAllocator::Config port_config; P2PPortAllocator::Config port_config;
...@@ -464,6 +465,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( ...@@ -464,6 +465,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
std::unique_ptr<webrtc::AsyncResolverFactory> std::unique_ptr<webrtc::AsyncResolverFactory>
PeerConnectionDependencyFactory::CreateAsyncResolverFactory() { PeerConnectionDependencyFactory::CreateAsyncResolverFactory() {
EnsureInitialized();
return std::make_unique<ProxyAsyncResolverFactory>(socket_factory_.get()); return std::make_unique<ProxyAsyncResolverFactory>(socket_factory_.get());
} }
......
...@@ -92,14 +92,12 @@ class DefaultIceTransportAdapterCrossThreadFactory ...@@ -92,14 +92,12 @@ class DefaultIceTransportAdapterCrossThreadFactory
auto* rtc_dependency_factory = auto* rtc_dependency_factory =
blink::PeerConnectionDependencyFactory::GetInstance(); blink::PeerConnectionDependencyFactory::GetInstance();
rtc_dependency_factory->EnsureInitialized();
port_allocator_ = rtc_dependency_factory->CreatePortAllocator( port_allocator_ = rtc_dependency_factory->CreatePortAllocator(
frame.Client()->GetWebFrame()); frame.Client()->GetWebFrame());
async_resolver_factory_ = async_resolver_factory_ =
Platform::Current()->CreateWebRtcAsyncResolverFactory(); rtc_dependency_factory->CreateAsyncResolverFactory();
worker_thread_rtc_thread_ = PeerConnectionDependencyFactory::GetInstance() worker_thread_rtc_thread_ =
->GetWebRtcWorkerThreadRtcThread(); rtc_dependency_factory->GetWebRtcWorkerThreadRtcThread();
} }
std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread( std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread(
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/webrtc/api/async_resolver_factory.h"
#include "third_party/webrtc/api/rtp_parameters.h" #include "third_party/webrtc/api/rtp_parameters.h"
#include "third_party/webrtc/p2p/base/port_allocator.h" #include "third_party/webrtc/p2p/base/port_allocator.h"
...@@ -342,14 +341,4 @@ Platform::CreateRTCPeerConnectionHandler( ...@@ -342,14 +341,4 @@ Platform::CreateRTCPeerConnectionHandler(
return nullptr; return nullptr;
} }
std::unique_ptr<cricket::PortAllocator> Platform::CreateWebRtcPortAllocator(
WebLocalFrame* frame) {
return nullptr;
}
std::unique_ptr<webrtc::AsyncResolverFactory>
Platform::CreateWebRtcAsyncResolverFactory() {
return nullptr;
}
} // namespace blink } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment