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

Side by Side Diff: webrtc/p2p/base/portallocator.h

Issue 2590153002: Revert of Add disabled certificate check support to IceServer PeerConnection API. (Closed)
Patch Set: Created 4 years 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/packetsocketfactory.h ('k') | webrtc/p2p/base/relayport.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // CF = CANDIDATE FILTER 89 // CF = CANDIDATE FILTER
90 enum { 90 enum {
91 CF_NONE = 0x0, 91 CF_NONE = 0x0,
92 CF_HOST = 0x1, 92 CF_HOST = 0x1,
93 CF_REFLEXIVE = 0x2, 93 CF_REFLEXIVE = 0x2,
94 CF_RELAY = 0x4, 94 CF_RELAY = 0x4,
95 CF_ALL = 0x7, 95 CF_ALL = 0x7,
96 }; 96 };
97 97
98 // TLS certificate policy.
99 enum class TlsCertPolicy {
100 // For TLS based protocols, ensure the connection is secure by not
101 // circumventing certificate validation.
102 TLS_CERT_POLICY_SECURE,
103 // For TLS based protocols, disregard security completely by skipping
104 // certificate validation. This is insecure and should never be used unless
105 // security is irrelevant in that particular context.
106 TLS_CERT_POLICY_INSECURE_NO_CHECK,
107 };
108
109 // TODO(deadbeef): Rename to TurnCredentials (and username to ufrag). 98 // TODO(deadbeef): Rename to TurnCredentials (and username to ufrag).
110 struct RelayCredentials { 99 struct RelayCredentials {
111 RelayCredentials() {} 100 RelayCredentials() {}
112 RelayCredentials(const std::string& username, const std::string& password) 101 RelayCredentials(const std::string& username, const std::string& password)
113 : username(username), password(password) {} 102 : username(username), password(password) {}
114 103
115 bool operator==(const RelayCredentials& o) const { 104 bool operator==(const RelayCredentials& o) const {
116 return username == o.username && password == o.password; 105 return username == o.username && password == o.password;
117 } 106 }
118 bool operator!=(const RelayCredentials& o) const { return !(*this == o); } 107 bool operator!=(const RelayCredentials& o) const { return !(*this == o); }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 bool operator==(const RelayServerConfig& o) const { 140 bool operator==(const RelayServerConfig& o) const {
152 return type == o.type && ports == o.ports && credentials == o.credentials && 141 return type == o.type && ports == o.ports && credentials == o.credentials &&
153 priority == o.priority; 142 priority == o.priority;
154 } 143 }
155 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); } 144 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); }
156 145
157 RelayType type; 146 RelayType type;
158 PortList ports; 147 PortList ports;
159 RelayCredentials credentials; 148 RelayCredentials credentials;
160 int priority = 0; 149 int priority = 0;
161 TlsCertPolicy tls_cert_policy = TlsCertPolicy::TLS_CERT_POLICY_SECURE;
162 }; 150 };
163 151
164 class PortAllocatorSession : public sigslot::has_slots<> { 152 class PortAllocatorSession : public sigslot::has_slots<> {
165 public: 153 public:
166 // Content name passed in mostly for logging and debugging. 154 // Content name passed in mostly for logging and debugging.
167 PortAllocatorSession(const std::string& content_name, 155 PortAllocatorSession(const std::string& content_name,
168 int component, 156 int component,
169 const std::string& ice_ufrag, 157 const std::string& ice_ufrag,
170 const std::string& ice_pwd, 158 const std::string& ice_pwd,
171 uint32_t flags); 159 uint32_t flags);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 int candidate_pool_size_ = 0; // Last value passed into SetConfiguration. 428 int candidate_pool_size_ = 0; // Last value passed into SetConfiguration.
441 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 429 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
442 bool prune_turn_ports_ = false; 430 bool prune_turn_ports_ = false;
443 431
444 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; 432 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr;
445 }; 433 };
446 434
447 } // namespace cricket 435 } // namespace cricket
448 436
449 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 437 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/packetsocketfactory.h ('k') | webrtc/p2p/base/relayport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698