QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/third_party/quiche/src/quic/test_tools/quic_flow_controller_peer.h" |
| 6 | |
| 7 | #include <list> |
| 8 | |
| 9 | #include "net/third_party/quiche/src/quic/core/quic_flow_controller.h" |
| 10 | #include "net/third_party/quiche/src/quic/core/quic_packets.h" |
| 11 | |
| 12 | namespace quic { |
| 13 | namespace test { |
| 14 | |
| 15 | // static |
| 16 | void QuicFlowControllerPeer::SetSendWindowOffset( |
| 17 | QuicFlowController* flow_controller, |
| 18 | QuicStreamOffset offset) { |
| 19 | flow_controller->send_window_offset_ = offset; |
| 20 | } |
| 21 | |
| 22 | // static |
| 23 | void QuicFlowControllerPeer::SetReceiveWindowOffset( |
| 24 | QuicFlowController* flow_controller, |
| 25 | QuicStreamOffset offset) { |
| 26 | flow_controller->receive_window_offset_ = offset; |
| 27 | } |
| 28 | |
| 29 | // static |
| 30 | void QuicFlowControllerPeer::SetMaxReceiveWindow( |
| 31 | QuicFlowController* flow_controller, |
| 32 | QuicByteCount window_size) { |
| 33 | flow_controller->receive_window_size_ = window_size; |
| 34 | } |
| 35 | |
| 36 | // static |
| 37 | QuicStreamOffset QuicFlowControllerPeer::SendWindowOffset( |
| 38 | QuicFlowController* flow_controller) { |
| 39 | return flow_controller->send_window_offset_; |
| 40 | } |
| 41 | |
| 42 | // static |
| 43 | QuicByteCount QuicFlowControllerPeer::SendWindowSize( |
| 44 | QuicFlowController* flow_controller) { |
| 45 | return flow_controller->SendWindowSize(); |
| 46 | } |
| 47 | |
| 48 | // static |
| 49 | QuicStreamOffset QuicFlowControllerPeer::ReceiveWindowOffset( |
| 50 | QuicFlowController* flow_controller) { |
| 51 | return flow_controller->receive_window_offset_; |
| 52 | } |
| 53 | |
| 54 | // static |
| 55 | QuicByteCount QuicFlowControllerPeer::ReceiveWindowSize( |
| 56 | QuicFlowController* flow_controller) { |
| 57 | return flow_controller->receive_window_offset_ - |
| 58 | flow_controller->highest_received_byte_offset_; |
| 59 | } |
| 60 | |
| 61 | // static |
| 62 | QuicByteCount QuicFlowControllerPeer::WindowUpdateThreshold( |
| 63 | QuicFlowController* flow_controller) { |
| 64 | return flow_controller->WindowUpdateThreshold(); |
| 65 | } |
| 66 | |
| 67 | } // namespace test |
| 68 | } // namespace quic |