| 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 server specific QuicSession subclass. | 5 // A server specific QuicSession subclass. |
| 6 | 6 |
| 7 #ifndef NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ | 7 #ifndef NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ |
| 8 #define NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ | 8 #define NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // |crypto_config| must outlive the session. | 69 // |crypto_config| must outlive the session. |
| 70 virtual void InitializeSession(const QuicCryptoServerConfig* crypto_config); | 70 virtual void InitializeSession(const QuicCryptoServerConfig* crypto_config); |
| 71 | 71 |
| 72 const QuicCryptoServerStream* crypto_stream() const { | 72 const QuicCryptoServerStream* crypto_stream() const { |
| 73 return crypto_stream_.get(); | 73 return crypto_stream_.get(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Override base class to process FEC config received from client. | 76 // Override base class to process FEC config received from client. |
| 77 void OnConfigNegotiated() override; | 77 void OnConfigNegotiated() override; |
| 78 | 78 |
| 79 bool UsingStatelessRejectsIfPeerSupported() { |
| 80 if (GetCryptoStream() == nullptr) { |
| 81 return false; |
| 82 } |
| 83 return GetCryptoStream()->use_stateless_rejects_if_peer_supported(); |
| 84 } |
| 85 |
| 86 bool PeerSupportsStatelessRejects() { |
| 87 if (GetCryptoStream() == nullptr) { |
| 88 return false; |
| 89 } |
| 90 return GetCryptoStream()->peer_supports_stateless_rejects(); |
| 91 } |
| 92 |
| 79 void set_serving_region(std::string serving_region) { | 93 void set_serving_region(std::string serving_region) { |
| 80 serving_region_ = serving_region; | 94 serving_region_ = serving_region; |
| 81 } | 95 } |
| 82 | 96 |
| 97 void set_use_stateless_rejects_if_peer_supported( |
| 98 bool use_stateless_rejects_if_peer_supported) { |
| 99 DCHECK(GetCryptoStream() != nullptr); |
| 100 GetCryptoStream()->set_use_stateless_rejects_if_peer_supported( |
| 101 use_stateless_rejects_if_peer_supported); |
| 102 } |
| 103 |
| 83 protected: | 104 protected: |
| 84 // QuicSession methods: | 105 // QuicSession methods: |
| 85 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 106 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; |
| 86 QuicDataStream* CreateOutgoingDataStream() override; | 107 QuicDataStream* CreateOutgoingDataStream() override; |
| 87 QuicCryptoServerStream* GetCryptoStream() override; | 108 QuicCryptoServerStream* GetCryptoStream() override; |
| 88 | 109 |
| 89 // If we should create an incoming stream, returns true. Otherwise | 110 // If we should create an incoming stream, returns true. Otherwise |
| 90 // does error handling, including communicating the error to the client and | 111 // does error handling, including communicating the error to the client and |
| 91 // possibly closing the connection, and returns false. | 112 // possibly closing the connection, and returns false. |
| 92 virtual bool ShouldCreateIncomingDataStream(QuicStreamId id); | 113 virtual bool ShouldCreateIncomingDataStream(QuicStreamId id); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 116 // Number of packets sent to the peer, at the time we last sent a SCUP. | 137 // Number of packets sent to the peer, at the time we last sent a SCUP. |
| 117 int64 last_scup_sequence_number_; | 138 int64 last_scup_sequence_number_; |
| 118 | 139 |
| 119 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); | 140 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); |
| 120 }; | 141 }; |
| 121 | 142 |
| 122 } // namespace tools | 143 } // namespace tools |
| 123 } // namespace net | 144 } // namespace net |
| 124 | 145 |
| 125 #endif // NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ | 146 #endif // NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_ |
| OLD | NEW |