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_sustained_bandwidth_recorder_peer.h"
7 #include "net/quic/quic_protocol.h"
8 #include "net/quic/quic_sustained_bandwidth_recorder.h"
14 void QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate(
15 QuicSustainedBandwidthRecorder* bandwidth_recorder,
16 int32 bandwidth_estimate_kbytes_per_second) {
17 bandwidth_recorder->has_estimate_ = true;
18 bandwidth_recorder->bandwidth_estimate_ =
19 QuicBandwidth::FromKBytesPerSecond(bandwidth_estimate_kbytes_per_second);
23 void QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate(
24 QuicSustainedBandwidthRecorder* bandwidth_recorder,
25 int32 max_bandwidth_estimate_kbytes_per_second,
26 int32 max_bandwidth_timestamp) {
27 bandwidth_recorder->max_bandwidth_estimate_ =
28 QuicBandwidth::FromKBytesPerSecond(
29 max_bandwidth_estimate_kbytes_per_second);
30 bandwidth_recorder->max_bandwidth_timestamp_ = max_bandwidth_timestamp;