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_CORE_QUIC_CLIENT_SESSION_BASE_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_CLIENT_SESSION_BASE_H_ |
6 #define NET_QUIC_CORE_QUIC_CLIENT_SESSION_BASE_H_ | 6 #define NET_QUIC_CORE_QUIC_CLIENT_SESSION_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "net/base/net_export.h" | |
12 #include "net/quic/core/quic_crypto_client_stream.h" | 11 #include "net/quic/core/quic_crypto_client_stream.h" |
13 #include "net/quic/core/quic_spdy_session.h" | 12 #include "net/quic/core/quic_spdy_session.h" |
| 13 #include "net/quic/platform/api/quic_export.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 class QuicClientPromisedInfo; | 17 class QuicClientPromisedInfo; |
18 class QuicClientPushPromiseIndex; | 18 class QuicClientPushPromiseIndex; |
19 class QuicSpdyClientStream; | 19 class QuicSpdyClientStream; |
20 | 20 |
21 // For client/http layer code. Lookup promised streams based on | 21 // For client/http layer code. Lookup promised streams based on |
22 // matching promised request url. The same map can be shared across | 22 // matching promised request url. The same map can be shared across |
23 // multiple sessions, since cross-origin pushes are allowed (subject | 23 // multiple sessions, since cross-origin pushes are allowed (subject |
24 // to authority constraints). Clients should use this map to enforce | 24 // to authority constraints). Clients should use this map to enforce |
25 // session affinity for requests corresponding to cross-origin push | 25 // session affinity for requests corresponding to cross-origin push |
26 // promised streams. | 26 // promised streams. |
27 using QuicPromisedByUrlMap = | 27 using QuicPromisedByUrlMap = |
28 std::unordered_map<std::string, QuicClientPromisedInfo*>; | 28 std::unordered_map<std::string, QuicClientPromisedInfo*>; |
29 | 29 |
30 // The maximum time a promises stream can be reserved without being | 30 // The maximum time a promises stream can be reserved without being |
31 // claimed by a client request. | 31 // claimed by a client request. |
32 const int64_t kPushPromiseTimeoutSecs = 60; | 32 const int64_t kPushPromiseTimeoutSecs = 60; |
33 | 33 |
34 // Base class for all client-specific QuicSession subclasses. | 34 // Base class for all client-specific QuicSession subclasses. |
35 class NET_EXPORT_PRIVATE QuicClientSessionBase | 35 class QUIC_EXPORT_PRIVATE QuicClientSessionBase |
36 : public QuicSpdySession, | 36 : public QuicSpdySession, |
37 public QuicCryptoClientStream::ProofHandler { | 37 public QuicCryptoClientStream::ProofHandler { |
38 public: | 38 public: |
39 // Takes ownership of |connection|. Caller retains ownership of | 39 // Takes ownership of |connection|. Caller retains ownership of |
40 // |promised_by_url|. | 40 // |promised_by_url|. |
41 QuicClientSessionBase(QuicConnection* connection, | 41 QuicClientSessionBase(QuicConnection* connection, |
42 QuicClientPushPromiseIndex* push_promise_index, | 42 QuicClientPushPromiseIndex* push_promise_index, |
43 const QuicConfig& config); | 43 const QuicConfig& config); |
44 | 44 |
45 ~QuicClientSessionBase() override; | 45 ~QuicClientSessionBase() override; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 QuicClientPushPromiseIndex* push_promise_index_; | 129 QuicClientPushPromiseIndex* push_promise_index_; |
130 QuicPromisedByIdMap promised_by_id_; | 130 QuicPromisedByIdMap promised_by_id_; |
131 QuicStreamId largest_promised_stream_id_; | 131 QuicStreamId largest_promised_stream_id_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); | 133 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace net | 136 } // namespace net |
137 | 137 |
138 #endif // NET_QUIC_CORE_QUIC_CLIENT_SESSION_BASE_H_ | 138 #endif // NET_QUIC_CORE_QUIC_CLIENT_SESSION_BASE_H_ |
OLD | NEW |