From 4ae6347ace824fd1a5a86ab26a4447b1a82676b2 Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Fri, 22 Feb 2019 00:57:06 +0100 Subject: [PATCH] Use `final` so that the compiler will be able to inline calls Bug: webrtc:9987 Change-Id: Ib5d344ea2b28e928140bbea297f72fb5672855e6 Reviewed-on: https://webrtc-review.googlesource.com/c/123223 Commit-Queue: Karl Wiberg Reviewed-by: Steve Anton Cr-Commit-Position: refs/heads/master@{#26806} --- pc/peer_connection.h | 8 +++----- pc/peer_connection_factory.cc | 14 -------------- pc/peer_connection_factory.h | 12 +++++++++--- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 3d22bf4fd7..376dcc0c4e 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -210,13 +210,11 @@ class PeerConnection : public PeerConnectionInternal, void Close() override; // PeerConnectionInternal implementation. - rtc::Thread* network_thread() const override { + rtc::Thread* network_thread() const final { return factory_->network_thread(); } - rtc::Thread* worker_thread() const override { - return factory_->worker_thread(); - } - rtc::Thread* signaling_thread() const override { + rtc::Thread* worker_thread() const final { return factory_->worker_thread(); } + rtc::Thread* signaling_thread() const final { return factory_->signaling_thread(); } diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc index a2852bec52..9fd8b73d66 100644 --- a/pc/peer_connection_factory.cc +++ b/pc/peer_connection_factory.cc @@ -396,20 +396,6 @@ cricket::ChannelManager* PeerConnectionFactory::channel_manager() { return channel_manager_.get(); } -rtc::Thread* PeerConnectionFactory::signaling_thread() { - // This method can be called on a different thread when the factory is - // created in CreatePeerConnectionFactory(). - return signaling_thread_; -} - -rtc::Thread* PeerConnectionFactory::worker_thread() { - return worker_thread_; -} - -rtc::Thread* PeerConnectionFactory::network_thread() { - return network_thread_; -} - std::unique_ptr PeerConnectionFactory::CreateRtcEventLog_w() { RTC_DCHECK_RUN_ON(worker_thread_); diff --git a/pc/peer_connection_factory.h b/pc/peer_connection_factory.h index 99770878c6..40706cecd5 100644 --- a/pc/peer_connection_factory.h +++ b/pc/peer_connection_factory.h @@ -76,9 +76,15 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface { CreateSctpTransportInternalFactory(); virtual cricket::ChannelManager* channel_manager(); - virtual rtc::Thread* signaling_thread(); - virtual rtc::Thread* worker_thread(); - virtual rtc::Thread* network_thread(); + + rtc::Thread* signaling_thread() { + // This method can be called on a different thread when the factory is + // created in CreatePeerConnectionFactory(). + return signaling_thread_; + } + rtc::Thread* worker_thread() { return worker_thread_; } + rtc::Thread* network_thread() { return network_thread_; } + const Options& options() const { return options_; } MediaTransportFactory* media_transport_factory() {