OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A QuicSession, which demuxes a single connection to individual streams. | 5 // A QuicSession, which demuxes a single connection to individual streams. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SESSION_H_ |
8 #define NET_QUIC_QUIC_SESSION_H_ | 8 #define NET_QUIC_QUIC_SESSION_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
14 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
15 #include "net/quic/blocked_list.h" | 15 #include "net/quic/blocked_list.h" |
16 #include "net/quic/quic_connection.h" | 16 #include "net/quic/quic_connection.h" |
17 #include "net/quic/quic_crypto_stream.h" | 17 #include "net/quic/quic_crypto_stream.h" |
18 #include "net/quic/quic_packet_creator.h" | 18 #include "net/quic/quic_packet_creator.h" |
19 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/quic_protocol.h" |
20 #include "net/quic/quic_spdy_compressor.h" | 20 #include "net/quic/quic_spdy_compressor.h" |
21 #include "net/quic/quic_spdy_decompressor.h" | 21 #include "net/quic/quic_spdy_decompressor.h" |
22 #include "net/quic/reliable_quic_stream.h" | 22 #include "net/quic/reliable_quic_stream.h" |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 | 25 |
26 class ProofVerifier; | |
26 class QuicCryptoStream; | 27 class QuicCryptoStream; |
27 class ReliableQuicStream; | 28 class ReliableQuicStream; |
28 class VisitorShim; | 29 class VisitorShim; |
29 | 30 |
30 namespace test { | 31 namespace test { |
31 class QuicSessionPeer; | 32 class QuicSessionPeer; |
32 } // namespace test | 33 } // namespace test |
33 | 34 |
34 class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { | 35 class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { |
35 public: | 36 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 // Called by the QuicCryptoStream when the handshake enters a new state. | 98 // Called by the QuicCryptoStream when the handshake enters a new state. |
98 // | 99 // |
99 // Clients will call this function in the order: | 100 // Clients will call this function in the order: |
100 // ENCRYPTION_FIRST_ESTABLISHED | 101 // ENCRYPTION_FIRST_ESTABLISHED |
101 // zero or more ENCRYPTION_REESTABLISHED | 102 // zero or more ENCRYPTION_REESTABLISHED |
102 // HANDSHAKE_CONFIRMED | 103 // HANDSHAKE_CONFIRMED |
103 // | 104 // |
104 // Servers will simply call it once with HANDSHAKE_CONFIRMED. | 105 // Servers will simply call it once with HANDSHAKE_CONFIRMED. |
105 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event); | 106 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event); |
106 | 107 |
108 virtual ProofVerifier* proof_verifier() const; | |
109 | |
110 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are | |
111 // free to use in order to verify certificate chains from servers. If a | |
112 // ProofVerifier is set then the client will request a certificate chain from | |
113 // the server. | |
114 virtual void SetProofVerifier(ProofVerifier* verifier); | |
wtc
2013/07/03 00:20:26
Nit: the names of the getter and setter methods fo
ramant (doing other things)
2013/07/03 05:46:34
Used the same names as it is defined in "QuicCrypt
| |
115 | |
107 // Returns mutable config for this session. Returned config is owned | 116 // Returns mutable config for this session. Returned config is owned |
108 // by QuicSession. | 117 // by QuicSession. |
109 QuicConfig* config(); | 118 QuicConfig* config(); |
110 | 119 |
111 // Returns true if the stream existed previously and has been closed. | 120 // Returns true if the stream existed previously and has been closed. |
112 // Returns false if the stream is still active or if the stream has | 121 // Returns false if the stream is still active or if the stream has |
113 // not yet been created. | 122 // not yet been created. |
114 bool IsClosedStream(QuicStreamId id); | 123 bool IsClosedStream(QuicStreamId id); |
115 | 124 |
116 QuicConnection* connection() { return connection_.get(); } | 125 QuicConnection* connection() { return connection_.get(); } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 // A shim to stand between the connection and the session, to handle stream | 216 // A shim to stand between the connection and the session, to handle stream |
208 // deletions. | 217 // deletions. |
209 scoped_ptr<VisitorShim> visitor_shim_; | 218 scoped_ptr<VisitorShim> visitor_shim_; |
210 | 219 |
211 std::vector<ReliableQuicStream*> closed_streams_; | 220 std::vector<ReliableQuicStream*> closed_streams_; |
212 | 221 |
213 QuicSpdyDecompressor decompressor_; | 222 QuicSpdyDecompressor decompressor_; |
214 QuicSpdyCompressor compressor_; | 223 QuicSpdyCompressor compressor_; |
215 | 224 |
216 QuicConfig config_; | 225 QuicConfig config_; |
226 scoped_ptr<ProofVerifier> proof_verifier_; | |
217 | 227 |
218 // Returns the maximum number of streams this connection can open. | 228 // Returns the maximum number of streams this connection can open. |
219 size_t max_open_streams_; | 229 size_t max_open_streams_; |
220 | 230 |
221 // Map from StreamId to pointers to streams that are owned by the caller. | 231 // Map from StreamId to pointers to streams that are owned by the caller. |
222 ReliableStreamMap stream_map_; | 232 ReliableStreamMap stream_map_; |
223 QuicStreamId next_stream_id_; | 233 QuicStreamId next_stream_id_; |
224 bool is_server_; | 234 bool is_server_; |
225 | 235 |
226 // Set of stream ids that have been "implicitly created" by receipt | 236 // Set of stream ids that have been "implicitly created" by receipt |
(...skipping 16 matching lines...) Expand all Loading... | |
243 bool goaway_received_; | 253 bool goaway_received_; |
244 // Whether a GoAway has been sent. | 254 // Whether a GoAway has been sent. |
245 bool goaway_sent_; | 255 bool goaway_sent_; |
246 | 256 |
247 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 257 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
248 }; | 258 }; |
249 | 259 |
250 } // namespace net | 260 } // namespace net |
251 | 261 |
252 #endif // NET_QUIC_QUIC_SESSION_H_ | 262 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |