OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/tools/quic/quic_client_base.h" | 5 #include "net/tools/quic/quic_client_base.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_random.h" | 7 #include "net/quic/crypto/quic_random.h" |
8 #include "net/quic/quic_server_id.h" | 8 #include "net/quic/quic_server_id.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 30 matching lines...) Expand all Loading... |
41 QuicPacketWriter* QuicClientBase::DummyPacketWriterFactory::Create( | 41 QuicPacketWriter* QuicClientBase::DummyPacketWriterFactory::Create( |
42 QuicConnection* /*connection*/) const { | 42 QuicConnection* /*connection*/) const { |
43 return writer_; | 43 return writer_; |
44 } | 44 } |
45 | 45 |
46 QuicClientSession* QuicClientBase::CreateQuicClientSession( | 46 QuicClientSession* QuicClientBase::CreateQuicClientSession( |
47 QuicConnection* connection) { | 47 QuicConnection* connection) { |
48 session_.reset( | 48 session_.reset( |
49 new QuicClientSession(config_, connection, server_id_, &crypto_config_)); | 49 new QuicClientSession(config_, connection, server_id_, &crypto_config_)); |
50 if (initial_max_packet_length_ != 0) { | 50 if (initial_max_packet_length_ != 0) { |
51 session()->connection()->set_max_packet_length(initial_max_packet_length_); | 51 session()->connection()->SetMaxPacketLength(initial_max_packet_length_); |
52 } | 52 } |
53 return session_.get(); | 53 return session_.get(); |
54 } | 54 } |
55 | 55 |
56 bool QuicClientBase::EncryptionBeingEstablished() { | 56 bool QuicClientBase::EncryptionBeingEstablished() { |
57 return !session_->IsEncryptionEstablished() && | 57 return !session_->IsEncryptionEstablished() && |
58 session_->connection()->connected(); | 58 session_->connection()->connected(); |
59 } | 59 } |
60 | 60 |
61 QuicSpdyClientStream* QuicClientBase::CreateReliableClientStream() { | 61 QuicSpdyClientStream* QuicClientBase::CreateReliableClientStream() { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ? cached->GetNextServerDesignatedConnectionId() | 136 ? cached->GetNextServerDesignatedConnectionId() |
137 : 0; | 137 : 0; |
138 } | 138 } |
139 | 139 |
140 QuicConnectionId QuicClientBase::GenerateNewConnectionId() { | 140 QuicConnectionId QuicClientBase::GenerateNewConnectionId() { |
141 return QuicRandom::GetInstance()->RandUint64(); | 141 return QuicRandom::GetInstance()->RandUint64(); |
142 } | 142 } |
143 | 143 |
144 } // namespace tools | 144 } // namespace tools |
145 } // namespace net | 145 } // namespace net |
OLD | NEW |