ckrasic | 4f9d88d | 2015-07-22 22:23:16 | [diff] [blame] | 1 | // Copyright (c) 2013 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 | |
Ryan Hamilton | a3ee93a7 | 2018-08-01 22:03:08 | [diff] [blame] | 5 | #include "net/quic/quic_chromium_client_session_peer.h" |
ckrasic | 4f9d88d | 2015-07-22 22:23:16 | [diff] [blame] | 6 | |
Ryan Hamilton | a3ee93a7 | 2018-08-01 22:03:08 | [diff] [blame] | 7 | #include "net/quic/quic_chromium_client_session.h" |
Ramin Halavati | f7788ea | 2018-02-26 07:02:57 | [diff] [blame] | 8 | #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
ckrasic | 4f9d88d | 2015-07-22 22:23:16 | [diff] [blame] | 9 | |
| 10 | namespace net { |
| 11 | namespace test { |
ckrasic | 4f9d88d | 2015-07-22 22:23:16 | [diff] [blame] | 12 | // static |
rch | 1fe2eeb | 2015-10-26 14:45:57 | [diff] [blame] | 13 | void QuicChromiumClientSessionPeer::SetHostname( |
| 14 | QuicChromiumClientSession* session, |
| 15 | const std::string& hostname) { |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 16 | quic::QuicServerId server_id(hostname, |
| 17 | session->session_key_.server_id().port(), |
| 18 | session->session_key_.privacy_mode()); |
Paul Jensen | 8e3c5d3 | 2018-02-19 17:06:33 | [diff] [blame] | 19 | session->session_key_ = QuicSessionKey(server_id, SocketTag()); |
rch | 1fe2eeb | 2015-10-26 14:45:57 | [diff] [blame] | 20 | } |
| 21 | |
zhongyi | e34c03566 | 2016-10-19 22:26:02 | [diff] [blame] | 22 | // static |
| 23 | uint64_t QuicChromiumClientSessionPeer::GetPushedBytesCount( |
| 24 | QuicChromiumClientSession* session) { |
| 25 | return session->bytes_pushed_count_; |
| 26 | } |
| 27 | |
| 28 | // static |
| 29 | uint64_t QuicChromiumClientSessionPeer::GetPushedAndUnclaimedBytesCount( |
| 30 | QuicChromiumClientSession* session) { |
| 31 | return session->bytes_pushed_and_unclaimed_count_; |
| 32 | } |
Ramin Halavati | f7788ea | 2018-02-26 07:02:57 | [diff] [blame] | 33 | |
| 34 | // static |
Fan Yang | 5a3bddf | 2018-10-12 10:05:50 | [diff] [blame] | 35 | QuicChromiumClientStream* QuicChromiumClientSessionPeer::CreateOutgoingStream( |
Ramin Halavati | f7788ea | 2018-02-26 07:02:57 | [diff] [blame] | 36 | QuicChromiumClientSession* session) { |
Fan Yang | 32c5a11 | 2018-12-10 20:06:33 | [diff] [blame] | 37 | return session->ShouldCreateOutgoingBidirectionalStream() |
Ramin Halavati | f7788ea | 2018-02-26 07:02:57 | [diff] [blame] | 38 | ? session->CreateOutgoingReliableStreamImpl( |
| 39 | TRAFFIC_ANNOTATION_FOR_TESTS) |
| 40 | : nullptr; |
| 41 | } |
| 42 | |
ckrasic | 4f9d88d | 2015-07-22 22:23:16 | [diff] [blame] | 43 | } // namespace test |
| 44 | } // namespace net |