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 #ifndef MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ | 5 #ifndef MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ |
6 #define MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ | 6 #define MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "media/cast/cast_environment.h" | 14 #include "media/cast/cast_environment.h" |
14 #include "media/cast/net/cast_transport_config.h" | 15 #include "media/cast/net/cast_transport_config.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
18 class TickClock; | 19 class TickClock; |
19 } // namespace base | 20 } // namespace base |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 namespace cast { | 23 namespace cast { |
(...skipping 20 matching lines...) Expand all Loading... |
43 | 44 |
44 // Initiailize this loopback transport. | 45 // Initiailize this loopback transport. |
45 // Establish a flow of packets from |pipe| to |packet_receiver|. | 46 // Establish a flow of packets from |pipe| to |packet_receiver|. |
46 // | 47 // |
47 // The data flow looks like: | 48 // The data flow looks like: |
48 // SendPacket() -> |pipe| -> Fake loopback pipe -> |packet_receiver|. | 49 // SendPacket() -> |pipe| -> Fake loopback pipe -> |packet_receiver|. |
49 // | 50 // |
50 // If |pipe| is NULL then the data flow looks like: | 51 // If |pipe| is NULL then the data flow looks like: |
51 // SendPacket() -> Fake loopback pipe -> |packet_receiver|. | 52 // SendPacket() -> Fake loopback pipe -> |packet_receiver|. |
52 void Initialize( | 53 void Initialize( |
53 scoped_ptr<test::PacketPipe> pipe, | 54 std::unique_ptr<test::PacketPipe> pipe, |
54 const PacketReceiverCallback& packet_receiver, | 55 const PacketReceiverCallback& packet_receiver, |
55 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 56 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
56 base::TickClock* clock); | 57 base::TickClock* clock); |
57 | 58 |
58 private: | 59 private: |
59 const scoped_refptr<CastEnvironment> cast_environment_; | 60 const scoped_refptr<CastEnvironment> cast_environment_; |
60 scoped_ptr<test::PacketPipe> packet_pipe_; | 61 std::unique_ptr<test::PacketPipe> packet_pipe_; |
61 int64_t bytes_sent_; | 62 int64_t bytes_sent_; |
62 | 63 |
63 DISALLOW_COPY_AND_ASSIGN(LoopBackTransport); | 64 DISALLOW_COPY_AND_ASSIGN(LoopBackTransport); |
64 }; | 65 }; |
65 | 66 |
66 } // namespace cast | 67 } // namespace cast |
67 } // namespace media | 68 } // namespace media |
68 | 69 |
69 #endif // MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ | 70 #endif // MEDIA_CAST_TEST_LOOPBACK_TRANSPORT_H_ |
OLD | NEW |