| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
| 11 #ifndef WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ | 11 #ifndef WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ |
| 12 #define WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ | 12 #define WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <set> | 15 #include <set> |
| 15 #include <string.h> | 16 #include <string.h> |
| 16 #include <queue> | 17 #include <queue> |
| 17 | 18 |
| 18 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
| 19 #include "webrtc/base/criticalsection.h" | 20 #include "webrtc/base/criticalsection.h" |
| 20 #include "webrtc/base/random.h" | 21 #include "webrtc/base/random.h" |
| 21 #include "webrtc/base/scoped_ptr.h" | 22 #include "webrtc/base/scoped_ptr.h" |
| 22 #include "webrtc/typedefs.h" | 23 #include "webrtc/typedefs.h" |
| 23 | 24 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 uint8_t* data() const { return data_.get(); } | 44 uint8_t* data() const { return data_.get(); } |
| 44 size_t data_length() const { return data_length_; } | 45 size_t data_length() const { return data_length_; } |
| 45 int64_t send_time() const { return send_time_; } | 46 int64_t send_time() const { return send_time_; } |
| 46 int64_t arrival_time() const { return arrival_time_; } | 47 int64_t arrival_time() const { return arrival_time_; } |
| 47 void IncrementArrivalTime(int64_t extra_delay) { | 48 void IncrementArrivalTime(int64_t extra_delay) { |
| 48 arrival_time_ += extra_delay; | 49 arrival_time_ += extra_delay; |
| 49 } | 50 } |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 // The packet data. | 53 // The packet data. |
| 53 rtc::scoped_ptr<uint8_t[]> data_; | 54 std::unique_ptr<uint8_t[]> data_; |
| 54 // Length of data_. | 55 // Length of data_. |
| 55 size_t data_length_; | 56 size_t data_length_; |
| 56 // The time the packet was sent out on the network. | 57 // The time the packet was sent out on the network. |
| 57 const int64_t send_time_; | 58 const int64_t send_time_; |
| 58 // The time the packet should arrive at the receiver. | 59 // The time the packet should arrive at the receiver. |
| 59 int64_t arrival_time_; | 60 int64_t arrival_time_; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 // Class faking a network link. This is a simple and naive solution just faking | 63 // Class faking a network link. This is a simple and naive solution just faking |
| 63 // capacity and adding an extra transport delay in addition to the capacity | 64 // capacity and adding an extra transport delay in addition to the capacity |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 int64_t total_packet_delay_; | 135 int64_t total_packet_delay_; |
| 135 | 136 |
| 136 int64_t next_process_time_; | 137 int64_t next_process_time_; |
| 137 | 138 |
| 138 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); | 139 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace webrtc | 142 } // namespace webrtc |
| 142 | 143 |
| 143 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ | 144 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ |
| OLD | NEW |