Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: net/quic/core/quic_crypto_server_stream.h

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_crypto_client_stream_test.cc ('k') | net/quic/core/quic_crypto_server_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_crypto_server_stream.h
diff --git a/net/quic/core/quic_crypto_server_stream.h b/net/quic/core/quic_crypto_server_stream.h
index ffac09c0df5d5b8b852a5bf8d2d7f3396107cc93..0fc0a4edf7938df9059fccfca34c13a6c178dc95 100644
--- a/net/quic/core/quic_crypto_server_stream.h
+++ b/net/quic/core/quic_crypto_server_stream.h
@@ -34,7 +34,8 @@ class QuicCryptoServerStreamPeer;
// various code and test refactoring.
class NET_EXPORT_PRIVATE QuicCryptoServerStreamBase : public QuicCryptoStream {
public:
- explicit QuicCryptoServerStreamBase(QuicServerSessionBase* session);
+ explicit QuicCryptoServerStreamBase(QuicSession* session);
+
~QuicCryptoServerStreamBase() override {}
// Cancel any outstanding callbacks, such as asynchronous validation of client
@@ -76,11 +77,32 @@ class NET_EXPORT_PRIVATE QuicCryptoServerStreamBase : public QuicCryptoStream {
class NET_EXPORT_PRIVATE QuicCryptoServerStream
: public QuicCryptoServerStreamBase {
public:
+ class Helper {
+ public:
+ virtual ~Helper() {}
+
+ // Given the current connection_id, generates a new ConnectionId to
+ // be returned with a stateless reject.
+ virtual QuicConnectionId GenerateConnectionIdForReject(
+ QuicConnectionId connection_id) const = 0;
+
+ // Returns true if |message|, which was received on |self_address| is
+ // acceptable according to the visitor's policy. Otherwise, returns false
+ // and populates |error_details|.
+ virtual bool CanAcceptClientHello(const CryptoHandshakeMessage& message,
+ const IPEndPoint& self_address,
+ std::string* error_details) const = 0;
+ };
+
// |crypto_config| must outlive the stream.
+ // |session| must outlive the stream.
+ // |helper| must outlive the stream.
QuicCryptoServerStream(const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
bool use_stateless_rejects_if_peer_supported,
- QuicServerSessionBase* session);
+ QuicSession* session,
+ Helper* helper);
+
~QuicCryptoServerStream() override;
// From QuicCryptoServerStreamBase
@@ -193,6 +215,9 @@ class NET_EXPORT_PRIVATE QuicCryptoServerStream
// handshake message is being validated.
ValidateCallback* validate_client_hello_cb_;
+ // Pointer to the helper for this crypto stream. Must outlive this stream.
+ Helper* helper_;
+
// Number of handshake messages received by this stream.
uint8_t num_handshake_messages_;
« no previous file with comments | « net/quic/core/quic_crypto_client_stream_test.cc ('k') | net/quic/core/quic_crypto_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698