| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 5 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| 6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/quic/quic_client_promised_info.h" | 9 #include "net/quic/quic_client_promised_info.h" |
| 10 #include "net/quic/quic_crypto_client_stream.h" | 10 #include "net/quic/quic_crypto_client_stream.h" |
| 11 #include "net/quic/quic_spdy_session.h" | 11 #include "net/quic/quic_spdy_session.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 class QuicSpdyClientStream; | 15 class QuicSpdyClientStream; |
| 16 | 16 |
| 17 // For client/http layer code. Lookup promised streams based on | 17 // For client/http layer code. Lookup promised streams based on |
| 18 // matching promised request url. The same map can be shared across | 18 // matching promised request url. The same map can be shared across |
| 19 // multiple sessions, since cross-origin pushes are allowed (subject | 19 // multiple sessions, since cross-origin pushes are allowed (subject |
| 20 // to authority constraints). Clients should use this map to enforce | 20 // to authority constraints). Clients should use this map to enforce |
| 21 // session affinity for requests corresponding to cross-origin push | 21 // session affinity for requests corresponding to cross-origin push |
| 22 // promised streams. | 22 // promised streams. |
| 23 using QuicPromisedByUrlMap = | 23 using QuicPromisedByUrlMap = |
| 24 std::unordered_map<std::string, QuicClientPromisedInfo*>; | 24 std::unordered_map<std::string, QuicClientPromisedInfo*>; |
| 25 | 25 |
| 26 // Base class for all client-specific QuicSession subclasses. | 26 // Base class for all client-specific QuicSession subclasses. |
| 27 class NET_EXPORT_PRIVATE QuicClientSessionBase : public QuicSpdySession { | 27 class NET_EXPORT_PRIVATE QuicClientSessionBase |
| 28 : public QuicSpdySession, |
| 29 public QuicCryptoClientStream::ProofHandler { |
| 28 public: | 30 public: |
| 29 // Caller retains ownership of |promised_by_url|. | 31 // Caller retains ownership of |promised_by_url|. |
| 30 QuicClientSessionBase(QuicConnection* connection, | 32 QuicClientSessionBase(QuicConnection* connection, |
| 31 QuicPromisedByUrlMap* promised_by_url, | 33 QuicPromisedByUrlMap* promised_by_url, |
| 32 const QuicConfig& config); | 34 const QuicConfig& config); |
| 33 | 35 |
| 34 ~QuicClientSessionBase() override; | 36 ~QuicClientSessionBase() override; |
| 35 | 37 |
| 36 // Called when the proof in |cached| is marked valid. If this is a secure | |
| 37 // QUIC session, then this will happen only after the proof verifier | |
| 38 // completes. | |
| 39 virtual void OnProofValid( | |
| 40 const QuicCryptoClientConfig::CachedState& cached) = 0; | |
| 41 | |
| 42 // Called when proof verification details become available, either because | |
| 43 // proof verification is complete, or when cached details are used. This | |
| 44 // will only be called for secure QUIC connections. | |
| 45 virtual void OnProofVerifyDetailsAvailable( | |
| 46 const ProofVerifyDetails& verify_details) = 0; | |
| 47 | |
| 48 // Override base class to set FEC policy before any data is sent by client. | 38 // Override base class to set FEC policy before any data is sent by client. |
| 49 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; | 39 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; |
| 50 | 40 |
| 51 // Called by |headers_stream_| when push promise headers have been | 41 // Called by |headers_stream_| when push promise headers have been |
| 52 // received for a stream. | 42 // received for a stream. |
| 53 void OnPromiseHeaders(QuicStreamId stream_id, | 43 void OnPromiseHeaders(QuicStreamId stream_id, |
| 54 StringPiece headers_data) override; | 44 StringPiece headers_data) override; |
| 55 | 45 |
| 56 // Called by |headers_stream_| when push promise headers have been | 46 // Called by |headers_stream_| when push promise headers have been |
| 57 // completely received. |fin| will be true if the fin flag was set | 47 // completely received. |fin| will be true if the fin flag was set |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 QuicPromisedByUrlMap* promised_by_url_; | 95 QuicPromisedByUrlMap* promised_by_url_; |
| 106 QuicPromisedByIdMap promised_by_id_; | 96 QuicPromisedByIdMap promised_by_id_; |
| 107 QuicStreamId largest_promised_stream_id_; | 97 QuicStreamId largest_promised_stream_id_; |
| 108 | 98 |
| 109 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); | 99 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); |
| 110 }; | 100 }; |
| 111 | 101 |
| 112 } // namespace net | 102 } // namespace net |
| 113 | 103 |
| 114 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 104 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| OLD | NEW |