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 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ | 5 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ |
6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ | 6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ |
7 | 7 |
8 #include "net/quic/core/quic_server_session_base.h" | 8 #include "net/quic/core/quic_server_session_base.h" |
9 #include "net/tools/quic/quic_dispatcher.h" | 9 #include "net/tools/quic/quic_dispatcher.h" |
10 #include "net/tools/quic/quic_http_response_cache.h" | 10 #include "net/tools/quic/quic_http_response_cache.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
14 class QuicSimpleDispatcher : public QuicDispatcher { | 14 class QuicSimpleDispatcher : public QuicDispatcher { |
15 public: | 15 public: |
16 QuicSimpleDispatcher( | 16 QuicSimpleDispatcher( |
17 const QuicConfig& config, | 17 const QuicConfig& config, |
18 const QuicCryptoServerConfig* crypto_config, | 18 const QuicCryptoServerConfig* crypto_config, |
19 QuicVersionManager* version_manager, | 19 QuicVersionManager* version_manager, |
20 std::unique_ptr<QuicConnectionHelperInterface> helper, | 20 std::unique_ptr<QuicConnectionHelperInterface> helper, |
21 std::unique_ptr<QuicCryptoServerStream::Helper> session_helper, | 21 std::unique_ptr<QuicCryptoServerStream::Helper> session_helper, |
22 std::unique_ptr<QuicAlarmFactory> alarm_factory, | 22 std::unique_ptr<QuicAlarmFactory> alarm_factory, |
23 QuicHttpResponseCache* response_cache); | 23 QuicHttpResponseCache* response_cache); |
24 | 24 |
25 ~QuicSimpleDispatcher() override; | 25 ~QuicSimpleDispatcher() override; |
26 | 26 |
| 27 int GetRstErrorCount(QuicRstStreamErrorCode rst_error_code) const; |
| 28 |
| 29 void OnRstStreamReceived(const QuicRstStreamFrame& frame) override; |
| 30 |
27 protected: | 31 protected: |
28 QuicServerSessionBase* CreateQuicSession( | 32 QuicServerSessionBase* CreateQuicSession( |
29 QuicConnectionId connection_id, | 33 QuicConnectionId connection_id, |
30 const QuicSocketAddress& client_address) override; | 34 const QuicSocketAddress& client_address) override; |
31 | 35 |
32 QuicHttpResponseCache* response_cache() { return response_cache_; } | 36 QuicHttpResponseCache* response_cache() { return response_cache_; } |
33 | 37 |
34 private: | 38 private: |
35 QuicHttpResponseCache* response_cache_; // Unowned. | 39 QuicHttpResponseCache* response_cache_; // Unowned. |
| 40 |
| 41 // The map of the reset error code with its counter. |
| 42 std::map<QuicRstStreamErrorCode, int> rst_error_map_; |
36 }; | 43 }; |
37 | 44 |
38 } // namespace net | 45 } // namespace net |
39 | 46 |
40 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ | 47 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_ |
OLD | NEW |