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 #include <stdint.h> | 5 #include <stdint.h> |
6 #include <cstdio> | 6 #include <cstdio> |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.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/threading/thread_task_runner_handle.h" |
20 #include "media/cast/test/utility/udp_proxy.h" | 20 #include "media/cast/test/utility/udp_proxy.h" |
21 #include "net/base/ip_address.h" | 21 #include "net/base/ip_address.h" |
22 | 22 |
23 class ByteCounter { | 23 class ByteCounter { |
24 public: | 24 public: |
25 ByteCounter() : bytes_(0), packets_(0) { | 25 ByteCounter() : bytes_(0), packets_(0) { |
26 push(base::TimeTicks::Now()); | 26 push(base::TimeTicks::Now()); |
27 } | 27 } |
28 | 28 |
29 base::TimeDelta time_range() { | 29 base::TimeDelta time_range() { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 std::unique_ptr<media::cast::test::UDPProxy> proxy( | 197 std::unique_ptr<media::cast::test::UDPProxy> proxy( |
198 media::cast::test::UDPProxy::Create(local_endpoint, remote_endpoint, | 198 media::cast::test::UDPProxy::Create(local_endpoint, remote_endpoint, |
199 std::move(in_pipe), | 199 std::move(in_pipe), |
200 std::move(out_pipe), NULL)); | 200 std::move(out_pipe), NULL)); |
201 base::MessageLoop message_loop; | 201 base::MessageLoop message_loop; |
202 g_counter.Get().last_printout = base::TimeTicks::Now(); | 202 g_counter.Get().last_printout = base::TimeTicks::Now(); |
203 CheckByteCounters(); | 203 CheckByteCounters(); |
204 message_loop.Run(); | 204 message_loop.Run(); |
205 return 1; | 205 return 1; |
206 } | 206 } |
OLD | NEW |