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

Side by Side Diff: webrtc/p2p/client/basicportallocator.cc

Issue 2623313004: Replace RTC_DCHECK(false) with RTC_NOTREACHED(). (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « webrtc/p2p/base/transportcontroller.cc ('k') | webrtc/pc/channel.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Gets protocol priority: UDP > TCP > SSLTCP. 51 // Gets protocol priority: UDP > TCP > SSLTCP.
52 int GetProtocolPriority(cricket::ProtocolType protocol) { 52 int GetProtocolPriority(cricket::ProtocolType protocol) {
53 switch (protocol) { 53 switch (protocol) {
54 case cricket::PROTO_UDP: 54 case cricket::PROTO_UDP:
55 return 2; 55 return 2;
56 case cricket::PROTO_TCP: 56 case cricket::PROTO_TCP:
57 return 1; 57 return 1;
58 case cricket::PROTO_SSLTCP: 58 case cricket::PROTO_SSLTCP:
59 return 0; 59 return 0;
60 default: 60 default:
61 RTC_DCHECK(false); 61 RTC_NOTREACHED();
62 return 0; 62 return 0;
63 } 63 }
64 } 64 }
65 // Gets address family priority: IPv6 > IPv4 > Unspecified. 65 // Gets address family priority: IPv6 > IPv4 > Unspecified.
66 int GetAddressFamilyPriority(int ip_family) { 66 int GetAddressFamilyPriority(int ip_family) {
67 switch (ip_family) { 67 switch (ip_family) {
68 case AF_INET6: 68 case AF_INET6:
69 return 2; 69 return 2;
70 case AF_INET: 70 case AF_INET:
71 return 1; 71 return 1;
72 default: 72 default:
73 RTC_DCHECK(false); 73 RTC_NOTREACHED();
74 return 0; 74 return 0;
75 } 75 }
76 } 76 }
77 77
78 // Returns positive if a is better, negative if b is better, and 0 otherwise. 78 // Returns positive if a is better, negative if b is better, and 0 otherwise.
79 int ComparePort(const cricket::Port* a, const cricket::Port* b) { 79 int ComparePort(const cricket::Port* a, const cricket::Port* b) {
80 int a_protocol = GetProtocolPriority(a->GetProtocol()); 80 int a_protocol = GetProtocolPriority(a->GetProtocol());
81 int b_protocol = GetProtocolPriority(b->GetProtocol()); 81 int b_protocol = GetProtocolPriority(b->GetProtocol());
82 int cmp_protocol = a_protocol - b_protocol; 82 int cmp_protocol = a_protocol - b_protocol;
83 if (cmp_protocol != 0) { 83 if (cmp_protocol != 0) {
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 ServerAddresses servers; 1518 ServerAddresses servers;
1519 for (size_t i = 0; i < relays.size(); ++i) { 1519 for (size_t i = 0; i < relays.size(); ++i) {
1520 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { 1520 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) {
1521 servers.insert(relays[i].ports.front().address); 1521 servers.insert(relays[i].ports.front().address);
1522 } 1522 }
1523 } 1523 }
1524 return servers; 1524 return servers;
1525 } 1525 }
1526 1526
1527 } // namespace cricket 1527 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transportcontroller.cc ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698