Commit a205d4f9 authored by Mirko Bonadei's avatar Mirko Bonadei Committed by Commit Bot

Remove workaround now that WebRTC supports component build.

Bug: webrtc:9419
Change-Id: I568367055910d651375ddc0c1903f674a6876fd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919345Reviewed-by: default avatarSteve Anton <steveanton@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715814}
parent b193565c
...@@ -122,9 +122,6 @@ class BLINK_MODULES_EXPORT PeerConnectionDependencyFactory ...@@ -122,9 +122,6 @@ class BLINK_MODULES_EXPORT PeerConnectionDependencyFactory
// An rtc::Thread will have already been created. // An rtc::Thread will have already been created.
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerTaskRunner(); scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerTaskRunner();
// 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.
rtc::Thread* GetWebRtcWorkerThreadRtcThread();
virtual scoped_refptr<base::SingleThreadTaskRunner> virtual scoped_refptr<base::SingleThreadTaskRunner>
GetWebRtcSignalingTaskRunner(); GetWebRtcSignalingTaskRunner();
......
...@@ -14,16 +14,10 @@ namespace blink { ...@@ -14,16 +14,10 @@ namespace blink {
IceTransportAdapterImpl::IceTransportAdapterImpl( IceTransportAdapterImpl::IceTransportAdapterImpl(
Delegate* delegate, Delegate* delegate,
std::unique_ptr<cricket::PortAllocator> port_allocator, std::unique_ptr<cricket::PortAllocator> port_allocator,
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory, std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory)
rtc::Thread* thread)
: delegate_(delegate), : delegate_(delegate),
port_allocator_(std::move(port_allocator)), port_allocator_(std::move(port_allocator)),
async_resolver_factory_(std::move(async_resolver_factory)) { async_resolver_factory_(std::move(async_resolver_factory)) {
// TODO(bugs.webrtc.org/9419): Remove once WebRTC can be built as a component.
if (!rtc::ThreadManager::Instance()->CurrentThread()) {
rtc::ThreadManager::Instance()->SetCurrentThread(thread);
}
// These settings are copied from PeerConnection: // These settings are copied from PeerConnection:
// https://codesearch.chromium.org/chromium/src/third_party/webrtc/pc/peerconnection.cc?l=4708&rcl=820ebd0f661696043959b5105b2814e0edd8b694 // https://codesearch.chromium.org/chromium/src/third_party/webrtc/pc/peerconnection.cc?l=4708&rcl=820ebd0f661696043959b5105b2814e0edd8b694
port_allocator_->set_step_delay(cricket::kMinimumStepDelay); port_allocator_->set_step_delay(cricket::kMinimumStepDelay);
...@@ -55,14 +49,8 @@ IceTransportAdapterImpl::IceTransportAdapterImpl( ...@@ -55,14 +49,8 @@ IceTransportAdapterImpl::IceTransportAdapterImpl(
IceTransportAdapterImpl::IceTransportAdapterImpl( IceTransportAdapterImpl::IceTransportAdapterImpl(
Delegate* delegate, Delegate* delegate,
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport, rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport)
rtc::Thread* thread)
: delegate_(delegate), ice_transport_channel_(ice_transport) { : delegate_(delegate), ice_transport_channel_(ice_transport) {
// TODO(bugs.webrtc.org/9419): Remove once WebRTC can be built as a component.
if (!rtc::ThreadManager::Instance()->CurrentThread()) {
rtc::ThreadManager::Instance()->SetCurrentThread(thread);
}
// The native webrtc peer connection might have been closed in the meantime, // The native webrtc peer connection might have been closed in the meantime,
// clearing the ice transport channel; don't do anything in that case. |this| // clearing the ice transport channel; don't do anything in that case. |this|
// will eventually be destroyed when the blink layer gets notified by the // will eventually be destroyed when the blink layer gets notified by the
......
...@@ -20,21 +20,17 @@ class IceTransportAdapterImpl final : public IceTransportAdapter, ...@@ -20,21 +20,17 @@ class IceTransportAdapterImpl final : public IceTransportAdapter,
public: public:
// Must be constructed on the WebRTC worker thread. // Must be constructed on the WebRTC worker thread.
// |delegate| must outlive the IceTransportAdapter. // |delegate| must outlive the IceTransportAdapter.
// |thread| should be the rtc::Thread instance associated with the WebRTC
// worker thread.
IceTransportAdapterImpl( IceTransportAdapterImpl(
Delegate* delegate, Delegate* delegate,
std::unique_ptr<cricket::PortAllocator> port_allocator, std::unique_ptr<cricket::PortAllocator> port_allocator,
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory, std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory);
rtc::Thread* thread);
// Create an IceTransportAdapter for an existing |ice_transport_channel| // Create an IceTransportAdapter for an existing |ice_transport_channel|
// object. In this case, |port_allocator_|, |async_resolver_factory_| and // object. In this case, |port_allocator_|, |async_resolver_factory_| and
// |quic_packet_transport_adapter_| are not used (and null). // |quic_packet_transport_adapter_| are not used (and null).
IceTransportAdapterImpl( IceTransportAdapterImpl(
Delegate* delegate, Delegate* delegate,
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_channel, rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_channel);
rtc::Thread* thread);
~IceTransportAdapterImpl() override; ~IceTransportAdapterImpl() override;
......
...@@ -608,12 +608,6 @@ PeerConnectionDependencyFactory::GetWebRtcWorkerTaskRunner() { ...@@ -608,12 +608,6 @@ PeerConnectionDependencyFactory::GetWebRtcWorkerTaskRunner() {
: nullptr; : nullptr;
} }
rtc::Thread* PeerConnectionDependencyFactory::GetWebRtcWorkerThreadRtcThread() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EnsureInitialized();
return chrome_worker_thread_.IsRunning() ? worker_thread_ : nullptr;
}
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
PeerConnectionDependencyFactory::GetWebRtcSignalingTaskRunner() { PeerConnectionDependencyFactory::GetWebRtcSignalingTaskRunner() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
......
...@@ -64,22 +64,17 @@ class DtlsIceTransportAdapterCrossThreadFactory ...@@ -64,22 +64,17 @@ class DtlsIceTransportAdapterCrossThreadFactory
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport) rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport)
: ice_transport_(ice_transport) {} : ice_transport_(ice_transport) {}
void InitializeOnMainThread(LocalFrame& frame) override { void InitializeOnMainThread(LocalFrame& frame) override {
DCHECK(!worker_thread_rtc_thread_);
worker_thread_rtc_thread_ = PeerConnectionDependencyFactory::GetInstance()
->GetWebRtcWorkerThreadRtcThread();
} }
std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread( std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread(
IceTransportAdapter::Delegate* delegate) override { IceTransportAdapter::Delegate* delegate) override {
DCHECK(ice_transport_); DCHECK(ice_transport_);
DCHECK(worker_thread_rtc_thread_); return std::make_unique<IceTransportAdapterImpl>(delegate,
return std::make_unique<IceTransportAdapterImpl>( std::move(ice_transport_));
delegate, std::move(ice_transport_), worker_thread_rtc_thread_);
} }
private: private:
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_; rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_;
rtc::Thread* worker_thread_rtc_thread_ = nullptr;
}; };
class DefaultIceTransportAdapterCrossThreadFactory class DefaultIceTransportAdapterCrossThreadFactory
...@@ -87,7 +82,6 @@ class DefaultIceTransportAdapterCrossThreadFactory ...@@ -87,7 +82,6 @@ class DefaultIceTransportAdapterCrossThreadFactory
public: public:
void InitializeOnMainThread(LocalFrame& frame) override { void InitializeOnMainThread(LocalFrame& frame) override {
DCHECK(!port_allocator_); DCHECK(!port_allocator_);
DCHECK(!worker_thread_rtc_thread_);
DCHECK(!async_resolver_factory_); DCHECK(!async_resolver_factory_);
auto* rtc_dependency_factory = auto* rtc_dependency_factory =
...@@ -96,24 +90,20 @@ class DefaultIceTransportAdapterCrossThreadFactory ...@@ -96,24 +90,20 @@ class DefaultIceTransportAdapterCrossThreadFactory
frame.Client()->GetWebFrame()); frame.Client()->GetWebFrame());
async_resolver_factory_ = async_resolver_factory_ =
rtc_dependency_factory->CreateAsyncResolverFactory(); rtc_dependency_factory->CreateAsyncResolverFactory();
worker_thread_rtc_thread_ =
rtc_dependency_factory->GetWebRtcWorkerThreadRtcThread();
} }
std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread( std::unique_ptr<IceTransportAdapter> ConstructOnWorkerThread(
IceTransportAdapter::Delegate* delegate) override { IceTransportAdapter::Delegate* delegate) override {
DCHECK(port_allocator_); DCHECK(port_allocator_);
DCHECK(worker_thread_rtc_thread_);
DCHECK(async_resolver_factory_); DCHECK(async_resolver_factory_);
return std::make_unique<IceTransportAdapterImpl>( return std::make_unique<IceTransportAdapterImpl>(
delegate, std::move(port_allocator_), delegate, std::move(port_allocator_),
std::move(async_resolver_factory_), worker_thread_rtc_thread_); std::move(async_resolver_factory_));
} }
private: private:
std::unique_ptr<cricket::PortAllocator> port_allocator_; std::unique_ptr<cricket::PortAllocator> port_allocator_;
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory_; std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory_;
rtc::Thread* worker_thread_rtc_thread_ = nullptr;
}; };
} // namespace } // namespace
......
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