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

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

Issue 2567243003: RTCStatsCollector: Utilize network thread to minimize thread hops. (Closed)
Patch Set: Rebase and rename Get[Session]Stats_n 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
« no previous file with comments | « 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 01394a97aaf19e6cce628e07b157c22b59abf458..4a3a00e10f0e2831e4eefcf6bd53d229086b0d84 100644
--- a/webrtc/p2p/base/transportcontroller.cc
+++ b/webrtc/p2p/base/transportcontroller.cc
@@ -141,6 +141,9 @@ 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));
@@ -149,6 +152,9 @@ 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);
+ }
return network_thread_->Invoke<std::unique_ptr<rtc::SSLCertificate>>(
RTC_FROM_HERE, rtc::Bind(&TransportController::GetRemoteSSLCertificate_n,
this, transport_name));
@@ -206,6 +212,9 @@ 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));
« no previous file with comments | « webrtc/api/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698