Commit 3ded8714 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Replace uses of blink::Platform::GetWebRtcWorkerThreadRtcThread

.. by calling PeerConnectionDependencyFactory::GetWebRtcWorkerThreadRtcThread()
directly.

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

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

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

Change-Id: I7e1a516dff8ffbfbe69101a70b02b3da71e3b632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807396
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706395}
parent d808143e
...@@ -558,13 +558,6 @@ RendererBlinkPlatformImpl::GetWebRtcWorkerThread() { ...@@ -558,13 +558,6 @@ RendererBlinkPlatformImpl::GetWebRtcWorkerThread() {
return rtc_dependency_factory->GetWebRtcWorkerThread(); return rtc_dependency_factory->GetWebRtcWorkerThread();
} }
rtc::Thread* RendererBlinkPlatformImpl::GetWebRtcWorkerThreadRtcThread() {
auto* rtc_dependency_factory =
blink::PeerConnectionDependencyFactory::GetInstance();
rtc_dependency_factory->EnsureInitialized();
return rtc_dependency_factory->GetWebRtcWorkerThreadRtcThread();
}
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
RendererBlinkPlatformImpl::GetWebRtcSignalingTaskRunner() { RendererBlinkPlatformImpl::GetWebRtcSignalingTaskRunner() {
auto* rtc_dependency_factory = auto* rtc_dependency_factory =
......
...@@ -131,7 +131,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -131,7 +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;
rtc::Thread* GetWebRtcWorkerThreadRtcThread() override;
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingTaskRunner() scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingTaskRunner()
override; override;
std::unique_ptr<cricket::PortAllocator> CreateWebRtcPortAllocator( std::unique_ptr<cricket::PortAllocator> CreateWebRtcPortAllocator(
......
...@@ -87,10 +87,6 @@ class MediaPermission; ...@@ -87,10 +87,6 @@ class MediaPermission;
class GpuVideoAcceleratorFactories; class GpuVideoAcceleratorFactories;
} }
namespace rtc {
class Thread;
}
namespace service_manager { namespace service_manager {
class InterfaceProvider; class InterfaceProvider;
} }
...@@ -580,11 +576,6 @@ class BLINK_PLATFORM_EXPORT Platform { ...@@ -580,11 +576,6 @@ class BLINK_PLATFORM_EXPORT Platform {
return nullptr; return nullptr;
} }
// Returns the rtc::Thread instance associated with the WebRTC worker thread.
// TODO(bugs.webrtc.org/9419): Remove once WebRTC can be built as a component.
// May return null if WebRTC functionality is not implemented.
virtual rtc::Thread* GetWebRtcWorkerThreadRtcThread() { return nullptr; }
virtual scoped_refptr<base::SingleThreadTaskRunner> virtual scoped_refptr<base::SingleThreadTaskRunner>
GetWebRtcSignalingTaskRunner() { GetWebRtcSignalingTaskRunner() {
return nullptr; return nullptr;
......
...@@ -118,8 +118,10 @@ class BLINK_MODULES_EXPORT PeerConnectionDependencyFactory ...@@ -118,8 +118,10 @@ class BLINK_MODULES_EXPORT PeerConnectionDependencyFactory
void EnsureInitialized(); void EnsureInitialized();
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() const; scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() const;
// Returns the rtc::Thread instance associated with the WebRTC worker thread.
// TODO(bugs.webrtc.org/9419): Remove once WebRTC can be built as a component. // TODO(bugs.webrtc.org/9419): Remove once WebRTC can be built as a component.
rtc::Thread* GetWebRtcWorkerThreadRtcThread() const; rtc::Thread* GetWebRtcWorkerThreadRtcThread();
virtual scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingThread() virtual scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingThread()
const; const;
......
...@@ -596,9 +596,9 @@ PeerConnectionDependencyFactory::GetWebRtcWorkerThread() const { ...@@ -596,9 +596,9 @@ PeerConnectionDependencyFactory::GetWebRtcWorkerThread() const {
: nullptr; : nullptr;
} }
rtc::Thread* PeerConnectionDependencyFactory::GetWebRtcWorkerThreadRtcThread() rtc::Thread* PeerConnectionDependencyFactory::GetWebRtcWorkerThreadRtcThread() {
const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EnsureInitialized();
return chrome_worker_thread_.IsRunning() ? worker_thread_ : nullptr; return chrome_worker_thread_.IsRunning() ? worker_thread_ : nullptr;
} }
......
...@@ -65,8 +65,8 @@ class DtlsIceTransportAdapterCrossThreadFactory ...@@ -65,8 +65,8 @@ class DtlsIceTransportAdapterCrossThreadFactory
: ice_transport_(ice_transport) {} : ice_transport_(ice_transport) {}
void InitializeOnMainThread(LocalFrame& frame) override { void InitializeOnMainThread(LocalFrame& frame) override {
DCHECK(!worker_thread_rtc_thread_); DCHECK(!worker_thread_rtc_thread_);
worker_thread_rtc_thread_ = worker_thread_rtc_thread_ = PeerConnectionDependencyFactory::GetInstance()
Platform::Current()->GetWebRtcWorkerThreadRtcThread(); ->GetWebRtcWorkerThreadRtcThread();
} }
std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread( std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread(
...@@ -98,8 +98,8 @@ class DefaultIceTransportAdapterCrossThreadFactory ...@@ -98,8 +98,8 @@ class DefaultIceTransportAdapterCrossThreadFactory
async_resolver_factory_ = async_resolver_factory_ =
Platform::Current()->CreateWebRtcAsyncResolverFactory(); Platform::Current()->CreateWebRtcAsyncResolverFactory();
worker_thread_rtc_thread_ = worker_thread_rtc_thread_ = PeerConnectionDependencyFactory::GetInstance()
Platform::Current()->GetWebRtcWorkerThreadRtcThread(); ->GetWebRtcWorkerThreadRtcThread();
} }
std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread( std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread(
......
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