| 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_crypto_client_stream.h" | 9 #include "net/quic/quic_crypto_client_stream.h" |
| 10 #include "net/quic/quic_spdy_session.h" | 10 #include "net/quic/quic_spdy_session.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // session affinity for requests corresponding to cross-origin push | 22 // session affinity for requests corresponding to cross-origin push |
| 23 // promised streams. | 23 // promised streams. |
| 24 using QuicPromisedByUrlMap = | 24 using QuicPromisedByUrlMap = |
| 25 std::unordered_map<std::string, QuicClientPromisedInfo*>; | 25 std::unordered_map<std::string, QuicClientPromisedInfo*>; |
| 26 | 26 |
| 27 // The maximum time a promises stream can be reserved without being | 27 // The maximum time a promises stream can be reserved without being |
| 28 // claimed by a client request. | 28 // claimed by a client request. |
| 29 const int64_t kPushPromiseTimeoutSecs = 60; | 29 const int64_t kPushPromiseTimeoutSecs = 60; |
| 30 | 30 |
| 31 // Base class for all client-specific QuicSession subclasses. | 31 // Base class for all client-specific QuicSession subclasses. |
| 32 class NET_EXPORT_PRIVATE QuicClientSessionBase : public QuicSpdySession { | 32 class NET_EXPORT_PRIVATE QuicClientSessionBase |
| 33 : public QuicSpdySession, |
| 34 public QuicCryptoClientStream::ProofHandler { |
| 33 public: | 35 public: |
| 34 // Caller retains ownership of |promised_by_url|. | 36 // Caller retains ownership of |promised_by_url|. |
| 35 QuicClientSessionBase(QuicConnection* connection, | 37 QuicClientSessionBase(QuicConnection* connection, |
| 36 QuicClientPushPromiseIndex* push_promise_index, | 38 QuicClientPushPromiseIndex* push_promise_index, |
| 37 const QuicConfig& config); | 39 const QuicConfig& config); |
| 38 | 40 |
| 39 ~QuicClientSessionBase() override; | 41 ~QuicClientSessionBase() override; |
| 40 | 42 |
| 41 // Called when the proof in |cached| is marked valid. If this is a secure | |
| 42 // QUIC session, then this will happen only after the proof verifier | |
| 43 // completes. | |
| 44 virtual void OnProofValid( | |
| 45 const QuicCryptoClientConfig::CachedState& cached) = 0; | |
| 46 | |
| 47 // Called when proof verification details become available, either because | |
| 48 // proof verification is complete, or when cached details are used. This | |
| 49 // will only be called for secure QUIC connections. | |
| 50 virtual void OnProofVerifyDetailsAvailable( | |
| 51 const ProofVerifyDetails& verify_details) = 0; | |
| 52 | |
| 53 // Override base class to set FEC policy before any data is sent by client. | 43 // Override base class to set FEC policy before any data is sent by client. |
| 54 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; | 44 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) 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 // received for a stream. | 47 // received for a stream. |
| 58 void OnPromiseHeaders(QuicStreamId stream_id, | 48 void OnPromiseHeaders(QuicStreamId stream_id, |
| 59 StringPiece headers_data) override; | 49 StringPiece headers_data) override; |
| 60 | 50 |
| 61 // Called by |headers_stream_| when push promise headers have been | 51 // Called by |headers_stream_| when push promise headers have been |
| 62 // completely received. |fin| will be true if the fin flag was set | 52 // completely received. |fin| will be true if the fin flag was set |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 QuicClientPushPromiseIndex* push_promise_index_; | 112 QuicClientPushPromiseIndex* push_promise_index_; |
| 123 QuicPromisedByIdMap promised_by_id_; | 113 QuicPromisedByIdMap promised_by_id_; |
| 124 QuicStreamId largest_promised_stream_id_; | 114 QuicStreamId largest_promised_stream_id_; |
| 125 | 115 |
| 126 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); | 116 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); |
| 127 }; | 117 }; |
| 128 | 118 |
| 129 } // namespace net | 119 } // namespace net |
| 130 | 120 |
| 131 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 121 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| OLD | NEW |