Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / net / quic / test_tools / quic_flow_controller_peer.cc
blob35882ede4bf56529ca6e21be51c550655aa15224
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.
5 #include "net/quic/test_tools/quic_flow_controller_peer.h"
7 #include <list>
9 #include "net/quic/quic_flow_controller.h"
10 #include "net/quic/quic_protocol.h"
12 namespace net {
13 namespace test {
15 // static
16 void QuicFlowControllerPeer::SetSendWindowOffset(
17 QuicFlowController* flow_controller,
18 uint64 offset) {
19 flow_controller->send_window_offset_ = offset;
22 // static
23 void QuicFlowControllerPeer::SetReceiveWindowOffset(
24 QuicFlowController* flow_controller,
25 uint64 offset) {
26 flow_controller->receive_window_offset_ = offset;
29 // static
30 void QuicFlowControllerPeer::SetMaxReceiveWindow(
31 QuicFlowController* flow_controller, uint64 window_size) {
32 flow_controller->max_receive_window_ = window_size;
35 // static
36 uint64 QuicFlowControllerPeer::SendWindowOffset(
37 QuicFlowController* flow_controller) {
38 return flow_controller->send_window_offset_;
41 // static
42 uint64 QuicFlowControllerPeer::SendWindowSize(
43 QuicFlowController* flow_controller) {
44 return flow_controller->SendWindowSize();
47 // static
48 uint64 QuicFlowControllerPeer::ReceiveWindowOffset(
49 QuicFlowController* flow_controller) {
50 return flow_controller->receive_window_offset_;
53 // static
54 uint64 QuicFlowControllerPeer::ReceiveWindowSize(
55 QuicFlowController* flow_controller) {
56 return flow_controller->receive_window_offset_ -
57 flow_controller->highest_received_byte_offset_;
60 } // namespace test
61 } // namespace net