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

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

Issue 1231913003: Add methods to set the ICE connection receiving_timeout values. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 5 years, 5 months 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/p2p/base/transport.h ('k') | webrtc/p2p/base/transportchannelimpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transport.cc
diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc
index f9b7fd4a04379db2f0a124ef591bee4e010772c0..b96ae842b445c8b2c4e1215542f325a2fb2e3f7c 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -121,21 +121,22 @@ Transport::Transport(rtc::Thread* signaling_thread,
const std::string& content_name,
const std::string& type,
PortAllocator* allocator)
- : signaling_thread_(signaling_thread),
- worker_thread_(worker_thread),
- content_name_(content_name),
- type_(type),
- allocator_(allocator),
- destroyed_(false),
- readable_(TRANSPORT_STATE_NONE),
- writable_(TRANSPORT_STATE_NONE),
- receiving_(TRANSPORT_STATE_NONE),
- was_writable_(false),
- connect_requested_(false),
- ice_role_(ICEROLE_UNKNOWN),
- tiebreaker_(0),
- protocol_(ICEPROTO_HYBRID),
- remote_ice_mode_(ICEMODE_FULL) {
+ : signaling_thread_(signaling_thread),
+ worker_thread_(worker_thread),
+ content_name_(content_name),
+ type_(type),
+ allocator_(allocator),
+ destroyed_(false),
+ readable_(TRANSPORT_STATE_NONE),
+ writable_(TRANSPORT_STATE_NONE),
+ receiving_(TRANSPORT_STATE_NONE),
+ was_writable_(false),
+ connect_requested_(false),
+ ice_role_(ICEROLE_UNKNOWN),
+ tiebreaker_(0),
+ protocol_(ICEPROTO_HYBRID),
+ remote_ice_mode_(ICEMODE_FULL),
+ channel_receiving_timeout_(-1) {
}
Transport::~Transport() {
@@ -174,6 +175,19 @@ bool Transport::GetRemoteCertificate_w(rtc::SSLCertificate** cert) {
return iter->second->GetRemoteCertificate(cert);
}
+void Transport::SetChannelReceivingTimeout(int timeout_ms) {
+ worker_thread_->Invoke<void>(
+ Bind(&Transport::SetChannelReceivingTimeout_w, this, timeout_ms));
+}
+
+void Transport::SetChannelReceivingTimeout_w(int timeout_ms) {
+ ASSERT(worker_thread()->IsCurrent());
+ channel_receiving_timeout_ = timeout_ms;
+ for (const auto& kv : channels_) {
+ kv.second->SetReceivingTimeout(timeout_ms);
+ }
+}
+
bool Transport::SetLocalTransportDescription(
const TransportDescription& description,
ContentAction action,
@@ -233,6 +247,7 @@ TransportChannelImpl* Transport::CreateChannel_w(int component) {
// Push down our transport state to the new channel.
impl->SetIceRole(ice_role_);
impl->SetIceTiebreaker(tiebreaker_);
+ impl->SetReceivingTimeout(channel_receiving_timeout_);
// TODO(ronghuawu): Change CreateChannel_w to be able to return error since
// below Apply**Description_w calls can fail.
if (local_description_)
« no previous file with comments | « webrtc/p2p/base/transport.h ('k') | webrtc/p2p/base/transportchannelimpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698