Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window.h

Issue 2966403002: Added implementation of three classes in BBR,with unit-tests. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 11
12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WINDO W_H_ 12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WINDO W_H_
13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WINDO W_H_ 13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WINDO W_H_
14 14
15 #include <cstddef>
16 #include <cstdint>
philipel 2017/07/06 12:15:15 Do you need to include both of these?
gnish1 2017/07/07 13:43:34 Done.
17
18 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h"
19
15 namespace webrtc { 20 namespace webrtc {
16 namespace testing { 21 namespace testing {
17 namespace bwe { 22 namespace bwe {
18 class CongestionWindow { 23 class CongestionWindow {
19 public: 24 public:
20 void set_gain(float gain); 25 CongestionWindow();
21 size_t data_inflight(); 26 ~CongestionWindow();
22 int64_t GetCongestionWindow(); 27 int64_t GetCongestionWindow(BbrBweSender::Mode mode,
philipel 2017/07/06 12:15:15 Why int64_t as return type? Can the congestion win
gnish1 2017/07/07 13:43:34 Done.
23 28 int64_t bandwidth_estimate,
29 int64_t min_rtt,
30 float gain,
31 size_t bytes_acked,
32 int multiplier);
33 int64_t GetTargetCongestionWindow(int64_t bandwidth_estimate,
34 int64_t min_rtt,
35 float gain);
24 // Packet sent from sender, meaning it is inflight 36 // Packet sent from sender, meaning it is inflight
25 // until we receive it and we should add packet's size to data_inflight. 37 // until we receive it and we should add packet's size to data_inflight.
26 void PacketSent(); 38 void PacketSent(size_t sent_packet_size);
27 39
28 // Ack was received by sender, meaning 40 // Ack was received by sender, meaning
29 // packet is no longer inflight. 41 // packet is no longer inflight.
30 void AckReceived(); 42 void AckReceived(size_t received_packet_size);
43
44 size_t data_inflight() { return data_inflight_; }
45
46 private:
47 size_t data_inflight_;
31 }; 48 };
32 } // namespace bwe 49 } // namespace bwe
33 } // namespace testing 50 } // namespace testing
34 } // namespace webrtc 51 } // namespace webrtc
35 52
36 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WI NDOW_H_ 53 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_CONGESTION_WI NDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698