OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/quic/quartc/quartc_session.h" | 5 #include "net/quic/quartc/quartc_session.h" |
6 | 6 |
7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
8 #include "net/quic/platform/api/quic_string_piece.h" | 8 #include "net/quic/platform/api/quic_string_piece.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // The |message| is used to handle the return value of AddDefaultConfig | 125 // The |message| is used to handle the return value of AddDefaultConfig |
126 // which is raw pointer of the CryptoHandshakeMessage. | 126 // which is raw pointer of the CryptoHandshakeMessage. |
127 std::unique_ptr<CryptoHandshakeMessage> message( | 127 std::unique_ptr<CryptoHandshakeMessage> message( |
128 quic_crypto_server_config_->AddDefaultConfig( | 128 quic_crypto_server_config_->AddDefaultConfig( |
129 helper_->GetRandomGenerator(), helper_->GetClock(), options)); | 129 helper_->GetRandomGenerator(), helper_->GetClock(), options)); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 QuartcSession::~QuartcSession() {} | 133 QuartcSession::~QuartcSession() {} |
134 | 134 |
135 QuicCryptoStream* QuartcSession::GetCryptoStream() { | 135 const QuicCryptoStream* QuartcSession::GetCryptoStream() const { |
136 return crypto_stream_.get(); | 136 return crypto_stream_.get(); |
137 } | 137 } |
138 | 138 |
| 139 QuicCryptoStream* QuartcSession::GetMutableCryptoStream() { |
| 140 return crypto_stream_.get(); |
| 141 } |
| 142 |
139 QuartcStream* QuartcSession::CreateOutgoingDynamicStream( | 143 QuartcStream* QuartcSession::CreateOutgoingDynamicStream( |
140 SpdyPriority priority) { | 144 SpdyPriority priority) { |
141 return CreateDataStream(GetNextOutgoingStreamId(), priority); | 145 return CreateDataStream(GetNextOutgoingStreamId(), priority); |
142 } | 146 } |
143 | 147 |
144 void QuartcSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { | 148 void QuartcSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { |
145 QuicSession::OnCryptoHandshakeEvent(event); | 149 QuicSession::OnCryptoHandshakeEvent(event); |
146 if (event == HANDSHAKE_CONFIRMED) { | 150 if (event == HANDSHAKE_CONFIRMED) { |
147 DCHECK(IsEncryptionEstablished()); | 151 DCHECK(IsEncryptionEstablished()); |
148 DCHECK(IsCryptoHandshakeConfirmed()); | 152 DCHECK(IsCryptoHandshakeConfirmed()); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 ActivateStream(std::unique_ptr<QuicStream>(stream)); | 280 ActivateStream(std::unique_ptr<QuicStream>(stream)); |
277 // Register the stream to the QuicWriteBlockedList. |priority| is clamped | 281 // Register the stream to the QuicWriteBlockedList. |priority| is clamped |
278 // between 0 and 7, with 0 being the highest priority and 7 the lowest | 282 // between 0 and 7, with 0 being the highest priority and 7 the lowest |
279 // priority. | 283 // priority. |
280 write_blocked_streams()->RegisterStream(stream->id(), priority); | 284 write_blocked_streams()->RegisterStream(stream->id(), priority); |
281 } | 285 } |
282 return stream; | 286 return stream; |
283 } | 287 } |
284 | 288 |
285 } // namespace net | 289 } // namespace net |
OLD | NEW |