Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: webrtc/p2p/base/transportcontroller.cc

Issue 2567243003: RTCStatsCollector: Utilize network thread to minimize thread hops. (Closed)
Patch Set: Addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/api/webrtcsession.cc ('K') | « webrtc/api/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transportcontroller.cc
diff --git a/webrtc/p2p/base/transportcontroller.cc b/webrtc/p2p/base/transportcontroller.cc
index 4b24b1990d205a1ae12ec6cf87015ee50cf17822..de8434c83adac511e1e67c1e939719dbc443ec4f 100644
--- a/webrtc/p2p/base/transportcontroller.cc
+++ b/webrtc/p2p/base/transportcontroller.cc
@@ -112,6 +112,8 @@ bool TransportController::SetLocalCertificate(
bool TransportController::GetLocalCertificate(
const std::string& transport_name,
rtc::scoped_refptr<rtc::RTCCertificate>* certificate) const {
+ if (network_thread_->IsCurrent())
+ return GetLocalCertificate_n(transport_name, certificate);
return network_thread_->Invoke<bool>(
RTC_FROM_HERE, rtc::Bind(&TransportController::GetLocalCertificate_n,
this, transport_name, certificate));
@@ -120,6 +122,8 @@ bool TransportController::GetLocalCertificate(
std::unique_ptr<rtc::SSLCertificate>
TransportController::GetRemoteSSLCertificate(
const std::string& transport_name) const {
+ if (network_thread_->IsCurrent())
+ return GetRemoteSSLCertificate_n(transport_name);
pthatcher1 2016/12/15 23:19:00 {}, please. Throughout the file.
hbos 2016/12/16 10:38:02 Done.
return network_thread_->Invoke<std::unique_ptr<rtc::SSLCertificate>>(
RTC_FROM_HERE, rtc::Bind(&TransportController::GetRemoteSSLCertificate_n,
this, transport_name));
@@ -177,6 +181,8 @@ bool TransportController::ReadyForRemoteCandidates(
bool TransportController::GetStats(const std::string& transport_name,
TransportStats* stats) {
+ if (network_thread_->IsCurrent())
+ return GetStats_n(transport_name, stats);
return network_thread_->Invoke<bool>(
RTC_FROM_HERE,
rtc::Bind(&TransportController::GetStats_n, this, transport_name, stats));
« webrtc/api/webrtcsession.cc ('K') | « webrtc/api/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698