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

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

Issue 1415313004: Destroy a Connection if a CreatePermission request fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
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 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 local_candidate().address())); 1389 local_candidate().address()));
1390 1390
1391 // Change the local candidate of this Connection to the new prflx candidate. 1391 // Change the local candidate of this Connection to the new prflx candidate.
1392 local_candidate_index_ = port_->AddPrflxCandidate(new_local_candidate); 1392 local_candidate_index_ = port_->AddPrflxCandidate(new_local_candidate);
1393 1393
1394 // SignalStateChange to force a re-sort in P2PTransportChannel as this 1394 // SignalStateChange to force a re-sort in P2PTransportChannel as this
1395 // Connection's local candidate has changed. 1395 // Connection's local candidate has changed.
1396 SignalStateChange(this); 1396 SignalStateChange(this);
1397 } 1397 }
1398 1398
1399 ProxyConnection::ProxyConnection(Port* port, size_t index, 1399 ProxyConnection::ProxyConnection(Port* port,
1400 const Candidate& candidate) 1400 size_t index,
1401 : Connection(port, index, candidate), error_(0) { 1401 const Candidate& remote_candidate)
1402 } 1402 : Connection(port, index, remote_candidate) {}
1403 1403
1404 int ProxyConnection::Send(const void* data, size_t size, 1404 int ProxyConnection::Send(const void* data, size_t size,
1405 const rtc::PacketOptions& options) { 1405 const rtc::PacketOptions& options) {
1406 if (write_state_ == STATE_WRITE_INIT || write_state_ == STATE_WRITE_TIMEOUT) { 1406 if (write_state_ == STATE_WRITE_INIT || write_state_ == STATE_WRITE_TIMEOUT) {
1407 error_ = EWOULDBLOCK; 1407 error_ = EWOULDBLOCK;
1408 return SOCKET_ERROR; 1408 return SOCKET_ERROR;
1409 } 1409 }
1410 sent_packets_total_++; 1410 sent_packets_total_++;
1411 int sent = port_->SendTo(data, size, remote_candidate_.address(), 1411 int sent = port_->SendTo(data, size, remote_candidate_.address(),
1412 options, true); 1412 options, true);
1413 if (sent <= 0) { 1413 if (sent <= 0) {
1414 ASSERT(sent < 0); 1414 ASSERT(sent < 0);
1415 error_ = port_->GetError(); 1415 error_ = port_->GetError();
1416 sent_packets_discarded_++; 1416 sent_packets_discarded_++;
1417 } else { 1417 } else {
1418 send_rate_tracker_.AddSamples(sent); 1418 send_rate_tracker_.AddSamples(sent);
1419 } 1419 }
1420 return sent; 1420 return sent;
1421 } 1421 }
1422 1422
1423 } // namespace cricket 1423 } // namespace cricket
OLDNEW
« webrtc/p2p/base/port.h ('K') | « webrtc/p2p/base/port.h ('k') | webrtc/p2p/base/turnport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698