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

Unified Diff: net/quic/core/quic_server_session_base.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_sent_packet_manager_test.cc ('k') | net/quic/core/quic_server_session_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_server_session_base.h
diff --git a/net/quic/core/quic_server_session_base.h b/net/quic/core/quic_server_session_base.h
index 0a14a56084198d3408af6247594e99fedc5a6500..8a09fdeb91c78672b1ee5278b9cfd950c3e19fa8 100644
--- a/net/quic/core/quic_server_session_base.h
+++ b/net/quic/core/quic_server_session_base.h
@@ -54,32 +54,18 @@ class NET_EXPORT_PRIVATE QuicServerSessionBase : public QuicSpdySession {
// Called after the given connection is added to the time-wait std::list.
virtual void OnConnectionAddedToTimeWaitList(
QuicConnectionId connection_id) = 0;
- };
- // Provides helper functions for the session.
- 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;
+ // Called before a packet is going to be processed by |session|.
+ virtual void OnPacketBeingDispatchedToSession(
+ QuicServerSessionBase* session) = 0;
};
// Does not take ownership of |connection|. |crypto_config| must outlive the
- // session.
+ // session. |helper| must outlive any created crypto streams.
QuicServerSessionBase(const QuicConfig& config,
QuicConnection* connection,
Visitor* visitor,
- Helper* helper,
+ QuicCryptoServerStream::Helper* helper,
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache);
@@ -111,14 +97,6 @@ class NET_EXPORT_PRIVATE QuicServerSessionBase : public QuicSpdySession {
bool server_push_enabled() const { return server_push_enabled_; }
- // Delegates to the helper's GenerateConnectionIdForReject method.
- QuicConnectionId GenerateConnectionIdForReject(
- QuicConnectionId connection_id);
-
- // Delegates to the helper's CanAcceptClientHello method.
- bool CanAcceptClientHello(const CryptoHandshakeMessage& message,
- std::string* error_details);
-
protected:
// QuicSession methods(override them with return type of QuicSpdyStream*):
QuicCryptoServerStreamBase* GetCryptoStream() override;
@@ -142,6 +120,10 @@ class NET_EXPORT_PRIVATE QuicServerSessionBase : public QuicSpdySession {
void set_server_push_enabled(bool enable) { server_push_enabled_ = enable; }
+ Visitor* visitor() { return visitor_; }
+
+ QuicCryptoServerStream::Helper* stream_helper() { return helper_; }
+
private:
friend class test::QuicServerSessionBasePeer;
friend class test::QuicSimpleServerSessionPeer;
@@ -154,7 +136,10 @@ class NET_EXPORT_PRIVATE QuicServerSessionBase : public QuicSpdySession {
std::unique_ptr<QuicCryptoServerStreamBase> crypto_stream_;
Visitor* visitor_;
- Helper* helper_;
+
+ // Pointer to the helper used to create crypto server streams. Must outlive
+ // streams created via CreateQuicCryptoServerStream.
+ QuicCryptoServerStream::Helper* helper_;
// Whether bandwidth resumption is enabled for this connection.
bool bandwidth_resumption_enabled_;
« no previous file with comments | « net/quic/core/quic_sent_packet_manager_test.cc ('k') | net/quic/core/quic_server_session_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698