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 client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class CertVerifyResult; | 42 class CertVerifyResult; |
43 class DatagramClientSocket; | 43 class DatagramClientSocket; |
44 class QuicCryptoClientStreamFactory; | 44 class QuicCryptoClientStreamFactory; |
45 class QuicServerInfo; | 45 class QuicServerInfo; |
46 class QuicStreamFactory; | 46 class QuicStreamFactory; |
47 class SSLInfo; | 47 class SSLInfo; |
48 class TransportSecurityState; | 48 class TransportSecurityState; |
49 | 49 |
50 using TokenBindingSignatureMap = | 50 using TokenBindingSignatureMap = |
51 base::MRUCache<std::string, std::vector<uint8_t>>; | 51 base::MRUCache<std::pair<TokenBindingType, std::string>, |
| 52 std::vector<uint8_t>>; |
52 | 53 |
53 namespace test { | 54 namespace test { |
54 class QuicChromiumClientSessionPeer; | 55 class QuicChromiumClientSessionPeer; |
55 } // namespace test | 56 } // namespace test |
56 | 57 |
57 class NET_EXPORT_PRIVATE QuicChromiumClientSession | 58 class NET_EXPORT_PRIVATE QuicChromiumClientSession |
58 : public QuicClientSessionBase, | 59 : public QuicClientSessionBase, |
59 public QuicChromiumPacketReader::Visitor, | 60 public QuicChromiumPacketReader::Visitor, |
60 public QuicChromiumPacketWriter::Delegate { | 61 public QuicChromiumPacketWriter::Delegate { |
61 public: | 62 public: |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 191 |
191 // QuicChromiumPacketReader::Visitor methods: | 192 // QuicChromiumPacketReader::Visitor methods: |
192 void OnReadError(int result, const DatagramClientSocket* socket) override; | 193 void OnReadError(int result, const DatagramClientSocket* socket) override; |
193 bool OnPacket(const QuicReceivedPacket& packet, | 194 bool OnPacket(const QuicReceivedPacket& packet, |
194 IPEndPoint local_address, | 195 IPEndPoint local_address, |
195 IPEndPoint peer_address) override; | 196 IPEndPoint peer_address) override; |
196 | 197 |
197 // Gets the SSL connection information. | 198 // Gets the SSL connection information. |
198 bool GetSSLInfo(SSLInfo* ssl_info) const; | 199 bool GetSSLInfo(SSLInfo* ssl_info) const; |
199 | 200 |
200 // Signs the exported keying material used for Token Binding using key |*key| | 201 // Generates the signature used in Token Binding using key |*key| and for a |
201 // and puts the signature in |*out|. Returns a net error code. | 202 // Token Binding of type |tb_type|, putting the signature in |*out|. Returns a |
| 203 // net error code. |
202 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, | 204 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 205 TokenBindingType tb_type, |
203 std::vector<uint8_t>* out); | 206 std::vector<uint8_t>* out); |
204 | 207 |
205 // Performs a crypto handshake with the server. | 208 // Performs a crypto handshake with the server. |
206 int CryptoConnect(bool require_confirmation, | 209 int CryptoConnect(bool require_confirmation, |
207 const CompletionCallback& callback); | 210 const CompletionCallback& callback); |
208 | 211 |
209 // Resumes a crypto handshake with the server after a timeout. | 212 // Resumes a crypto handshake with the server after a timeout. |
210 int ResumeCryptoConnect(const CompletionCallback& callback); | 213 int ResumeCryptoConnect(const CompletionCallback& callback); |
211 | 214 |
212 // Causes the QuicConnectionHelper to start reading from all sockets | 215 // Causes the QuicConnectionHelper to start reading from all sockets |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // the current sockets_.size() == the passed in value. | 384 // the current sockets_.size() == the passed in value. |
382 bool migration_pending_; // True while migration is underway. | 385 bool migration_pending_; // True while migration is underway. |
383 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; | 386 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; |
384 | 387 |
385 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); | 388 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); |
386 }; | 389 }; |
387 | 390 |
388 } // namespace net | 391 } // namespace net |
389 | 392 |
390 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 393 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
OLD | NEW |