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

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

Issue 1549633004: Fill the remote pwd in ice candidates when an ICE credential is received. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix a type conversion issue. Created 4 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/candidate.h ('k') | webrtc/p2p/base/p2ptransportchannel.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 Connection* FindNextPingableConnection(); 171 Connection* FindNextPingableConnection();
172 172
173 // Public for unit tests. 173 // Public for unit tests.
174 const std::vector<Connection*>& connections() const { return connections_; } 174 const std::vector<Connection*>& connections() const { return connections_; }
175 175
176 // Public for unit tests. 176 // Public for unit tests.
177 PortAllocatorSession* allocator_session() { 177 PortAllocatorSession* allocator_session() {
178 return allocator_sessions_.back(); 178 return allocator_sessions_.back();
179 } 179 }
180 180
181 // Public for unit tests.
182 const std::vector<RemoteCandidate>& remote_candidates() const {
183 return remote_candidates_;
184 }
185
181 private: 186 private:
182 rtc::Thread* thread() { return worker_thread_; } 187 rtc::Thread* thread() { return worker_thread_; }
183 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } 188 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); }
184 189
185 // A transport channel is weak if the current best connection is either 190 // A transport channel is weak if the current best connection is either
186 // not receiving or not writable, or if there is no best connection at all. 191 // not receiving or not writable, or if there is no best connection at all.
187 bool weak() const; 192 bool weak() const;
188 void UpdateConnectionStates(); 193 void UpdateConnectionStates();
189 void RequestSort(); 194 void RequestSort();
190 void SortConnections(); 195 void SortConnections();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 void PruneConnections(); 245 void PruneConnections();
241 Connection* best_nominated_connection() const; 246 Connection* best_nominated_connection() const;
242 bool IsBackupConnection(Connection* conn) const; 247 bool IsBackupConnection(Connection* conn) const;
243 248
244 // Returns the latest remote ICE parameters or nullptr if there are no remote 249 // Returns the latest remote ICE parameters or nullptr if there are no remote
245 // ICE parameters yet. 250 // ICE parameters yet.
246 IceParameters* remote_ice() { 251 IceParameters* remote_ice() {
247 return remote_ice_parameters_.empty() ? nullptr 252 return remote_ice_parameters_.empty() ? nullptr
248 : &remote_ice_parameters_.back(); 253 : &remote_ice_parameters_.back();
249 } 254 }
255 // Returns the remote IceParameters and generation that match |ufrag|
256 // if found, and returns nullptr otherwise.
257 const IceParameters* FindRemoteIceFromUfrag(const std::string& ufrag,
258 uint32_t* generation);
250 // Returns the index of the latest remote ICE parameters, or 0 if no remote 259 // Returns the index of the latest remote ICE parameters, or 0 if no remote
251 // ICE parameters have been received. 260 // ICE parameters have been received.
252 uint32_t remote_ice_generation() { 261 uint32_t remote_ice_generation() {
253 return remote_ice_parameters_.empty() 262 return remote_ice_parameters_.empty()
254 ? 0 263 ? 0
255 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); 264 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1);
256 } 265 }
257 266
258 P2PTransport* transport_; 267 P2PTransport* transport_;
259 PortAllocator* allocator_; 268 PortAllocator* allocator_;
(...skipping 27 matching lines...) Expand all
287 bool gather_continually_ = false; 296 bool gather_continually_ = false;
288 int weak_ping_delay_ = WEAK_PING_DELAY; 297 int weak_ping_delay_ = WEAK_PING_DELAY;
289 TransportChannelState state_ = TransportChannelState::STATE_INIT; 298 TransportChannelState state_ = TransportChannelState::STATE_INIT;
290 299
291 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 300 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
292 }; 301 };
293 302
294 } // namespace cricket 303 } // namespace cricket
295 304
296 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 305 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/candidate.h ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698