OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "remoting/test/fake_socket_factory.h" | 8 #include "remoting/test/fake_socket_factory.h" |
9 | 9 |
10 #include <math.h> | 10 #include <math.h> |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/rand_util.h" | 17 #include "base/rand_util.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 #include "net/base/io_buffer.h" | 21 #include "net/base/io_buffer.h" |
22 #include "remoting/test/leaky_bucket.h" | 22 #include "remoting/test/leaky_bucket.h" |
23 #include "third_party/libjingle/source/talk/media/base/rtputils.h" | |
24 #include "third_party/webrtc/base/asyncpacketsocket.h" | 23 #include "third_party/webrtc/base/asyncpacketsocket.h" |
| 24 #include "third_party/webrtc/media/base/rtputils.h" |
25 | 25 |
26 namespace remoting { | 26 namespace remoting { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const int kPortRangeStart = 1024; | 30 const int kPortRangeStart = 1024; |
31 const int kPortRangeEnd = 65535; | 31 const int kPortRangeEnd = 65535; |
32 | 32 |
33 double GetNormalRandom(double average, double stddev) { | 33 double GetNormalRandom(double average, double stddev) { |
34 // Based on Box-Muller transform, see | 34 // Based on Box-Muller transform, see |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); | 331 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); |
332 if (iter == udp_sockets_.end()) { | 332 if (iter == udp_sockets_.end()) { |
333 // Invalid port number. | 333 // Invalid port number. |
334 return; | 334 return; |
335 } | 335 } |
336 | 336 |
337 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); | 337 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); |
338 } | 338 } |
339 | 339 |
340 } // namespace remoting | 340 } // namespace remoting |
OLD | NEW |