Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / quic / test_tools / quic_sustained_bandwidth_recorder_peer.cc
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/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h"
6
7 #include "net/quic/quic_protocol.h"
8 #include "net/quic/quic_sustained_bandwidth_recorder.h"
9
10 namespace net {
11 namespace test {
12
13 // static
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);
20 }
21
22 // static
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;
31 }
32
33 }  // namespace test
34 }  // namespace net