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 <kwiberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26806}
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 3d22bf4..376dcc0 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -210,13 +210,11 @@
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 a2852be..9fd8b73 100644
--- a/pc/peer_connection_factory.cc
+++ b/pc/peer_connection_factory.cc
@@ -396,20 +396,6 @@
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<RtcEventLog> PeerConnectionFactory::CreateRtcEventLog_w() {
RTC_DCHECK_RUN_ON(worker_thread_);
diff --git a/pc/peer_connection_factory.h b/pc/peer_connection_factory.h
index 9977087..40706ce 100644
--- a/pc/peer_connection_factory.h
+++ b/pc/peer_connection_factory.h
@@ -76,9 +76,15 @@
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() {