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

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: Created 5 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
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 IceParameters that match the ufrag, also fill the generation
pthatcher1 2015/12/28 21:33:59 Might read better as: "Returns the remote IceParam
honghaiz3 2015/12/30 18:59:33 If we use IceParameters* as the argument, we will
pthatcher1 2015/12/30 19:15:44 Good point about the double pointer. I don't thin
256 // based on the found index. If not found, return nullptr and assume the next
257 // (future) generation.
258 const IceParameters* FindRemoteIce(const std::string& ufrag,
259 uint32_t* generation);
250 // Returns the index of the latest remote ICE parameters, or 0 if no remote 260 // Returns the index of the latest remote ICE parameters, or 0 if no remote
251 // ICE parameters have been received. 261 // ICE parameters have been received.
252 uint32_t remote_ice_generation() { 262 uint32_t remote_ice_generation() {
253 return remote_ice_parameters_.empty() 263 return remote_ice_parameters_.empty()
254 ? 0 264 ? 0
255 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); 265 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1);
256 } 266 }
257 267
258 P2PTransport* transport_; 268 P2PTransport* transport_;
259 PortAllocator* allocator_; 269 PortAllocator* allocator_;
(...skipping 27 matching lines...) Expand all
287 bool gather_continually_ = false; 297 bool gather_continually_ = false;
288 int weak_ping_delay_ = WEAK_PING_DELAY; 298 int weak_ping_delay_ = WEAK_PING_DELAY;
289 TransportChannelState state_ = TransportChannelState::STATE_INIT; 299 TransportChannelState state_ = TransportChannelState::STATE_INIT;
290 300
291 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 301 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
292 }; 302 };
293 303
294 } // namespace cricket 304 } // namespace cricket
295 305
296 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 306 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698