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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1421123003: When all connections timed out on writing, delete them all. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge to head Created 5 years, 1 month 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
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1105
1106 // Notify upper layer about channel not writable state, if it was before. 1106 // Notify upper layer about channel not writable state, if it was before.
1107 void P2PTransportChannel::HandleNotWritable() { 1107 void P2PTransportChannel::HandleNotWritable() {
1108 ASSERT(worker_thread_ == rtc::Thread::Current()); 1108 ASSERT(worker_thread_ == rtc::Thread::Current());
1109 if (was_writable_) { 1109 if (was_writable_) {
1110 was_writable_ = false; 1110 was_writable_ = false;
1111 set_writable(false); 1111 set_writable(false);
1112 } 1112 }
1113 } 1113 }
1114 1114
1115 // If all connections timed out, delete them all.
1115 void P2PTransportChannel::HandleAllTimedOut() { 1116 void P2PTransportChannel::HandleAllTimedOut() {
1116 // Currently we are treating this as channel not writable. 1117 for (Connection* connection : connections_) {
1117 HandleNotWritable(); 1118 connection->Destroy();
1119 }
1118 } 1120 }
1119 1121
1120 bool P2PTransportChannel::weak() const { 1122 bool P2PTransportChannel::weak() const {
1121 return !best_connection_ || best_connection_->weak(); 1123 return !best_connection_ || best_connection_->weak();
1122 } 1124 }
1123 1125
1124 // If we have a best connection, return it, otherwise return top one in the 1126 // If we have a best connection, return it, otherwise return top one in the
1125 // list (later we will mark it best). 1127 // list (later we will mark it best).
1126 Connection* P2PTransportChannel::GetBestConnectionOnNetwork( 1128 Connection* P2PTransportChannel::GetBestConnectionOnNetwork(
1127 rtc::Network* network) const { 1129 rtc::Network* network) const {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 SignalSentPacket(this, sent_packet); 1375 SignalSentPacket(this, sent_packet);
1374 } 1376 }
1375 1377
1376 void P2PTransportChannel::OnReadyToSend(Connection* connection) { 1378 void P2PTransportChannel::OnReadyToSend(Connection* connection) {
1377 if (connection == best_connection_ && writable()) { 1379 if (connection == best_connection_ && writable()) {
1378 SignalReadyToSend(this); 1380 SignalReadyToSend(this);
1379 } 1381 }
1380 } 1382 }
1381 1383
1382 } // namespace cricket 1384 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698