Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires | 82 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires |
| 83 // the signaling part be updated correspondingly as well. | 83 // the signaling part be updated correspondingly as well. |
| 84 const char LOCAL_PORT_TYPE[] = "local"; | 84 const char LOCAL_PORT_TYPE[] = "local"; |
| 85 const char STUN_PORT_TYPE[] = "stun"; | 85 const char STUN_PORT_TYPE[] = "stun"; |
| 86 const char PRFLX_PORT_TYPE[] = "prflx"; | 86 const char PRFLX_PORT_TYPE[] = "prflx"; |
| 87 const char RELAY_PORT_TYPE[] = "relay"; | 87 const char RELAY_PORT_TYPE[] = "relay"; |
| 88 | 88 |
| 89 const char UDP_PROTOCOL_NAME[] = "udp"; | 89 const char UDP_PROTOCOL_NAME[] = "udp"; |
| 90 const char TCP_PROTOCOL_NAME[] = "tcp"; | 90 const char TCP_PROTOCOL_NAME[] = "tcp"; |
| 91 const char SSLTCP_PROTOCOL_NAME[] = "ssltcp"; | 91 const char SSLTCP_PROTOCOL_NAME[] = "ssltcp"; |
| 92 const char TLS_PROTOCOL_NAME[] = "tls"; | |
| 92 | 93 |
| 93 static const char* const PROTO_NAMES[] = { UDP_PROTOCOL_NAME, | 94 static const char* const PROTO_NAMES[] = {UDP_PROTOCOL_NAME, TCP_PROTOCOL_NAME, |
| 94 TCP_PROTOCOL_NAME, | 95 SSLTCP_PROTOCOL_NAME, |
| 95 SSLTCP_PROTOCOL_NAME }; | 96 TLS_PROTOCOL_NAME}; |
|
pthatcher1
2016/12/07 21:29:35
We should probably document what these things mean
Taylor Brandstetter
2016/12/08 01:36:40
I agree about documenting what these things mean.
hnsl1
2016/12/12 16:08:13
I agree there are different meanings here that sho
| |
| 96 | 97 |
| 97 const char* ProtoToString(ProtocolType proto) { | 98 const char* ProtoToString(ProtocolType proto) { |
| 98 return PROTO_NAMES[proto]; | 99 return PROTO_NAMES[proto]; |
| 99 } | 100 } |
| 100 | 101 |
| 101 bool StringToProto(const char* value, ProtocolType* proto) { | 102 bool StringToProto(const char* value, ProtocolType* proto) { |
| 102 for (size_t i = 0; i <= PROTO_LAST; ++i) { | 103 for (size_t i = 0; i <= PROTO_LAST; ++i) { |
| 103 if (_stricmp(PROTO_NAMES[i], value) == 0) { | 104 if (_stricmp(PROTO_NAMES[i], value) == 0) { |
| 104 *proto = static_cast<ProtocolType>(i); | 105 *proto = static_cast<ProtocolType>(i); |
| 105 return true; | 106 return true; |
| (...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1571 ASSERT(sent < 0); | 1572 ASSERT(sent < 0); |
| 1572 error_ = port_->GetError(); | 1573 error_ = port_->GetError(); |
| 1573 stats_.sent_discarded_packets++; | 1574 stats_.sent_discarded_packets++; |
| 1574 } else { | 1575 } else { |
| 1575 send_rate_tracker_.AddSamples(sent); | 1576 send_rate_tracker_.AddSamples(sent); |
| 1576 } | 1577 } |
| 1577 return sent; | 1578 return sent; |
| 1578 } | 1579 } |
| 1579 | 1580 |
| 1580 } // namespace cricket | 1581 } // namespace cricket |
| OLD | NEW |