OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 private: | 268 private: |
269 void OnServerResolved(int index, int result); | 269 void OnServerResolved(int index, int result); |
270 | 270 |
271 bool Done() { | 271 bool Done() { |
272 return num_request_sent_ >= requests_per_ip_ * all_servers_ips_.size(); | 272 return num_request_sent_ >= requests_per_ip_ * all_servers_ips_.size(); |
273 } | 273 } |
274 | 274 |
275 int GetTotalClientSockets() { return 1; } | 275 int GetTotalClientSockets() { return 1; } |
276 int GetTotalServerSockets() { | 276 int GetTotalServerSockets() { |
277 return (shared_socket_mode_ ? 1 : all_servers_ips_.size()) * | 277 return static_cast<int>( |
278 requests_per_ip_; | 278 (shared_socket_mode_ ? 1 : all_servers_ips_.size()) * requests_per_ip_); |
279 } | 279 } |
280 | 280 |
281 bool SendNextRequest(); | 281 bool SendNextRequest(); |
282 | 282 |
283 // Will be invoked in 1ms intervals and schedule the next request from the | 283 // Will be invoked in 1ms intervals and schedule the next request from the |
284 // |current_requester_| if the time has passed for another request. | 284 // |current_requester_| if the time has passed for another request. |
285 void MaybeScheduleStunRequests(); | 285 void MaybeScheduleStunRequests(); |
286 | 286 |
287 // End the probe with the given |status|. Invokes |fininsh_callback|, which | 287 // End the probe with the given |status|. Invokes |fininsh_callback|, which |
288 // may destroy the class. | 288 // may destroy the class. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 std::vector<Requester*> requesters_; | 341 std::vector<Requester*> requesters_; |
342 | 342 |
343 rtc::ThreadChecker thread_checker_; | 343 rtc::ThreadChecker thread_checker_; |
344 | 344 |
345 DISALLOW_COPY_AND_ASSIGN(StunProber); | 345 DISALLOW_COPY_AND_ASSIGN(StunProber); |
346 }; | 346 }; |
347 | 347 |
348 } // namespace stunprober | 348 } // namespace stunprober |
349 | 349 |
350 #endif // WEBRTC_P2P_STUNPROBER_STUNPROBER_H_ | 350 #endif // WEBRTC_P2P_STUNPROBER_STUNPROBER_H_ |
OLD | NEW |