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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 bool TransportController::SetLocalCertificate( 105 bool TransportController::SetLocalCertificate(
106 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { 106 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
107 return network_thread_->Invoke<bool>( 107 return network_thread_->Invoke<bool>(
108 RTC_FROM_HERE, rtc::Bind(&TransportController::SetLocalCertificate_n, 108 RTC_FROM_HERE, rtc::Bind(&TransportController::SetLocalCertificate_n,
109 this, certificate)); 109 this, certificate));
110 } 110 }
111 111
112 bool TransportController::GetLocalCertificate( 112 bool TransportController::GetLocalCertificate(
113 const std::string& transport_name, 113 const std::string& transport_name,
114 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) const { 114 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) const {
115 if (network_thread_->IsCurrent())
116 return GetLocalCertificate_n(transport_name, certificate);
115 return network_thread_->Invoke<bool>( 117 return network_thread_->Invoke<bool>(
116 RTC_FROM_HERE, rtc::Bind(&TransportController::GetLocalCertificate_n, 118 RTC_FROM_HERE, rtc::Bind(&TransportController::GetLocalCertificate_n,
117 this, transport_name, certificate)); 119 this, transport_name, certificate));
118 } 120 }
119 121
120 std::unique_ptr<rtc::SSLCertificate> 122 std::unique_ptr<rtc::SSLCertificate>
121 TransportController::GetRemoteSSLCertificate( 123 TransportController::GetRemoteSSLCertificate(
122 const std::string& transport_name) const { 124 const std::string& transport_name) const {
125 if (network_thread_->IsCurrent())
126 return GetRemoteSSLCertificate_n(transport_name);
pthatcher1 2016/12/15 23:19:00 {}, please. Throughout the file.
hbos 2016/12/16 10:38:02 Done.
123 return network_thread_->Invoke<std::unique_ptr<rtc::SSLCertificate>>( 127 return network_thread_->Invoke<std::unique_ptr<rtc::SSLCertificate>>(
124 RTC_FROM_HERE, rtc::Bind(&TransportController::GetRemoteSSLCertificate_n, 128 RTC_FROM_HERE, rtc::Bind(&TransportController::GetRemoteSSLCertificate_n,
125 this, transport_name)); 129 this, transport_name));
126 } 130 }
127 131
128 bool TransportController::SetLocalTransportDescription( 132 bool TransportController::SetLocalTransportDescription(
129 const std::string& transport_name, 133 const std::string& transport_name,
130 const TransportDescription& tdesc, 134 const TransportDescription& tdesc,
131 ContentAction action, 135 ContentAction action,
132 std::string* err) { 136 std::string* err) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 174
171 bool TransportController::ReadyForRemoteCandidates( 175 bool TransportController::ReadyForRemoteCandidates(
172 const std::string& transport_name) const { 176 const std::string& transport_name) const {
173 return network_thread_->Invoke<bool>( 177 return network_thread_->Invoke<bool>(
174 RTC_FROM_HERE, rtc::Bind(&TransportController::ReadyForRemoteCandidates_n, 178 RTC_FROM_HERE, rtc::Bind(&TransportController::ReadyForRemoteCandidates_n,
175 this, transport_name)); 179 this, transport_name));
176 } 180 }
177 181
178 bool TransportController::GetStats(const std::string& transport_name, 182 bool TransportController::GetStats(const std::string& transport_name,
179 TransportStats* stats) { 183 TransportStats* stats) {
184 if (network_thread_->IsCurrent())
185 return GetStats_n(transport_name, stats);
180 return network_thread_->Invoke<bool>( 186 return network_thread_->Invoke<bool>(
181 RTC_FROM_HERE, 187 RTC_FROM_HERE,
182 rtc::Bind(&TransportController::GetStats_n, this, transport_name, stats)); 188 rtc::Bind(&TransportController::GetStats_n, this, transport_name, stats));
183 } 189 }
184 190
185 void TransportController::SetMetricsObserver( 191 void TransportController::SetMetricsObserver(
186 webrtc::MetricsObserverInterface* metrics_observer) { 192 webrtc::MetricsObserverInterface* metrics_observer) {
187 return network_thread_->Invoke<void>( 193 return network_thread_->Invoke<void>(
188 RTC_FROM_HERE, rtc::Bind(&TransportController::SetMetricsObserver_n, this, 194 RTC_FROM_HERE, rtc::Bind(&TransportController::SetMetricsObserver_n, this,
189 metrics_observer)); 195 metrics_observer));
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, 829 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE,
824 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); 830 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state));
825 } 831 }
826 } 832 }
827 833
828 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { 834 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) {
829 SignalDtlsHandshakeError(error); 835 SignalDtlsHandshakeError(error);
830 } 836 }
831 837
832 } // namespace cricket 838 } // namespace cricket
OLDNEW
« 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