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. | 5 // A client specific QuicSession subclass. |
6 | 6 |
7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ | 7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ | 8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "net/quic/quic_client_session_base.h" | 13 #include "net/quic/quic_client_session_base.h" |
14 #include "net/quic/quic_crypto_client_stream.h" | 14 #include "net/quic/quic_crypto_client_stream.h" |
15 #include "net/quic/quic_protocol.h" | 15 #include "net/quic/quic_protocol.h" |
16 #include "net/tools/quic/quic_spdy_client_stream.h" | 16 #include "net/tools/quic/quic_spdy_client_stream.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 class QuicConnection; | 20 class QuicConnection; |
21 class QuicServerId; | 21 class QuicServerId; |
22 class ReliableQuicStream; | 22 class ReliableQuicStream; |
23 | 23 |
24 namespace tools { | 24 namespace tools { |
25 | 25 |
| 26 // The maximum time a promises stream can be reserved without being |
| 27 // claimed by a client request. |
| 28 const int64_t kPushPromiseTimeoutSecs = 60; |
| 29 |
26 class QuicClientSession : public QuicClientSessionBase { | 30 class QuicClientSession : public QuicClientSessionBase { |
27 public: | 31 public: |
28 QuicClientSession(const QuicConfig& config, | 32 QuicClientSession(const QuicConfig& config, |
29 QuicConnection* connection, | 33 QuicConnection* connection, |
30 const QuicServerId& server_id, | 34 const QuicServerId& server_id, |
31 QuicCryptoClientConfig* crypto_config); | 35 QuicCryptoClientConfig* crypto_config); |
32 ~QuicClientSession() override; | 36 ~QuicClientSession() override; |
33 // Set up the QuicClientSession. Must be called prior to use. | 37 // Set up the QuicClientSession. Must be called prior to use. |
34 void Initialize() override; | 38 void Initialize() override; |
35 | 39 |
(...skipping 29 matching lines...) Expand all Loading... |
65 // Unlike CreateOutgoingDynamicStream, which applies a bunch of sanity checks, | 69 // Unlike CreateOutgoingDynamicStream, which applies a bunch of sanity checks, |
66 // this simply returns a new QuicSpdyClientStream. This may be used by | 70 // this simply returns a new QuicSpdyClientStream. This may be used by |
67 // subclasses which want to use a subclass of QuicSpdyClientStream for streams | 71 // subclasses which want to use a subclass of QuicSpdyClientStream for streams |
68 // but wish to use the sanity checks in CreateOutgoingDynamicStream. | 72 // but wish to use the sanity checks in CreateOutgoingDynamicStream. |
69 virtual QuicSpdyClientStream* CreateClientStream(); | 73 virtual QuicSpdyClientStream* CreateClientStream(); |
70 | 74 |
71 const QuicServerId& server_id() { return server_id_; } | 75 const QuicServerId& server_id() { return server_id_; } |
72 QuicCryptoClientConfig* crypto_config() { return crypto_config_; } | 76 QuicCryptoClientConfig* crypto_config() { return crypto_config_; } |
73 | 77 |
74 private: | 78 private: |
| 79 bool ShouldCreateIncomingDynamicStream(QuicStreamId id); |
75 scoped_ptr<QuicCryptoClientStreamBase> crypto_stream_; | 80 scoped_ptr<QuicCryptoClientStreamBase> crypto_stream_; |
76 QuicServerId server_id_; | 81 QuicServerId server_id_; |
77 QuicCryptoClientConfig* crypto_config_; | 82 QuicCryptoClientConfig* crypto_config_; |
78 | 83 |
79 // If this is set to false, the client will ignore server GOAWAYs and allow | 84 // If this is set to false, the client will ignore server GOAWAYs and allow |
80 // the creation of streams regardless of the high chance they will fail. | 85 // the creation of streams regardless of the high chance they will fail. |
81 bool respect_goaway_; | 86 bool respect_goaway_; |
82 | 87 |
83 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 88 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
84 }; | 89 }; |
85 | 90 |
86 } // namespace tools | 91 } // namespace tools |
87 } // namespace net | 92 } // namespace net |
88 | 93 |
89 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ | 94 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
OLD | NEW |