Change QuartcClientEndpoint to handle client-side version negotiation.
This allows Quartc to stop forcing the "no connection version negotiation" flags
to false, as QuartcEndpoint can now handle version negotiation properly in
either case. (QuartcServerEndpoint already handles server-side version
negotiation through the QuartcDispatcher.) In-connection version negotiation is
not fully reliable anyway, as some features of new QUIC versions cannot be
enabled or disabled in-place within a QuicConnection object (for example,
changes to how stream ids are allocated).
This only requires three changes:
- QuartcEndpoint::Delegate extends QuartcSession::Delegate
- QuartcClientEndpoint sits between the session and the final delegate
- When QuartcClientEndpoint sees a QUIC_INVALID_VERSION error, it picks another
version and tries again
This change is mostly cleanup to combine Endpoint and Session delegates and add
required overrides to existing delegates.
The only other minor change required is that QuartcMediaTransport must now
accept more than one call to OnSessionCreated(). All we have to do is remove
the DCHECK to allow this--nothing else assumes it will only happen once.
gfe-relnote: n/a (Quartc only)
PiperOrigin-RevId: 248378366
Change-Id: I442bd69e45f5d65e43d3e99118159f11dc595169
diff --git a/quic/quartc/quartc_endpoint.cc b/quic/quartc/quartc_endpoint.cc
index fe87ca1..7676c59 100644
--- a/quic/quartc/quartc_endpoint.cc
+++ b/quic/quartc/quartc_endpoint.cc
@@ -67,17 +67,72 @@
void QuartcClientEndpoint::Connect(QuartcPacketTransport* packet_transport) {
packet_transport_ = packet_transport;
+ // For the first attempt to connect, use any version that the client supports.
+ current_versions_ = version_manager_->GetSupportedVersions();
create_session_alarm_->Set(clock_->Now());
}
void QuartcClientEndpoint::OnCreateSessionAlarm() {
session_ = CreateQuartcClientSession(
config_, clock_, alarm_factory_, connection_helper_.get(),
- version_manager_->GetSupportedVersions(), serialized_server_config_,
- packet_transport_);
+ current_versions_, serialized_server_config_, packet_transport_);
+ session_->SetDelegate(this);
delegate_->OnSessionCreated(session_.get());
}
+void QuartcClientEndpoint::OnCryptoHandshakeComplete() {
+ delegate_->OnCryptoHandshakeComplete();
+}
+
+void QuartcClientEndpoint::OnConnectionWritable() {
+ delegate_->OnConnectionWritable();
+}
+
+void QuartcClientEndpoint::OnIncomingStream(QuartcStream* stream) {
+ delegate_->OnIncomingStream(stream);
+}
+
+void QuartcClientEndpoint::OnCongestionControlChange(
+ QuicBandwidth bandwidth_estimate,
+ QuicBandwidth pacing_rate,
+ QuicTime::Delta latest_rtt) {
+ delegate_->OnCongestionControlChange(bandwidth_estimate, pacing_rate,
+ latest_rtt);
+}
+
+void QuartcClientEndpoint::OnConnectionClosed(QuicErrorCode error_code,
+ const std::string& error_details,
+ ConnectionCloseSource source) {
+ // First, see if we can restart the session with a mutually-supported version.
+ if (error_code == QUIC_INVALID_VERSION && session_ &&
+ session_->connection() &&
+ !session_->connection()->server_supported_versions().empty()) {
+ for (const auto& client_version :
+ version_manager_->GetSupportedVersions()) {
+ if (QuicContainsValue(session_->connection()->server_supported_versions(),
+ client_version)) {
+ // Found a mutually-supported version. Reconnect using that version.
+ current_versions_.clear();
+ current_versions_.push_back(client_version);
+ create_session_alarm_->Set(clock_->Now());
+ return;
+ }
+ }
+ }
+
+ // Permanent version negotiation errors are forwarded to the |delegate_|,
+ // along with all other errors.
+ delegate_->OnConnectionClosed(error_code, error_details, source);
+}
+
+void QuartcClientEndpoint::OnMessageReceived(QuicStringPiece message) {
+ delegate_->OnMessageReceived(message);
+}
+
+void QuartcClientEndpoint::OnMessageSent(int64_t datagram_id) {
+ delegate_->OnMessageSent(datagram_id);
+}
+
QuartcServerEndpoint::QuartcServerEndpoint(
QuicAlarmFactory* alarm_factory,
const QuicClock* clock,
@@ -115,6 +170,7 @@
}
void QuartcServerEndpoint::OnSessionCreated(QuartcSession* session) {
+ session->SetDelegate(delegate_);
delegate_->OnSessionCreated(session);
}
diff --git a/quic/quartc/quartc_endpoint.h b/quic/quartc/quartc_endpoint.h
index 1169403..6c7644c 100644
--- a/quic/quartc/quartc_endpoint.h
+++ b/quic/quartc/quartc_endpoint.h
@@ -10,6 +10,7 @@
#include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_clock.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
#include "net/third_party/quiche/src/quic/quartc/quartc_connection_helper.h"
#include "net/third_party/quiche/src/quic/quartc/quartc_crypto_helpers.h"
#include "net/third_party/quiche/src/quic/quartc/quartc_dispatcher.h"
@@ -29,22 +30,23 @@
// Endpoint (client or server) in a peer-to-peer Quartc connection.
class QuartcEndpoint {
public:
- class Delegate {
+ class Delegate : public QuartcSession::Delegate {
public:
virtual ~Delegate() = default;
// Called when an endpoint creates a new session, before any packets are
// processed or sent. The callee should perform any additional
- // configuration required, such as setting a session delegate, before
+ // configuration required, such as setting up congestion control, before
// returning. |session| is owned by the endpoint, but remains safe to use
- // until another call to |OnSessionCreated| occurs, at which point previous
- // session is destroyed.
+ // until another call to |OnSessionCreated| or |OnConnectionClosed| occurs,
+ // at which point previous session may be destroyed.
+ //
+ // Callees must not change the |session|'s delegate. The Endpoint itself
+ // manages the delegate and will forward calls.
+ //
+ // New calls to |OnSessionCreated| will only occur prior to
+ // |OnConnectionWritable|, during initial connection negotiation.
virtual void OnSessionCreated(QuartcSession* session) = 0;
-
- // Called if the endpoint fails to establish a session after a call to
- // Connect. (The most likely cause is a network idle timeout.)
- virtual void OnConnectError(QuicErrorCode error,
- const std::string& error_details) = 0;
};
virtual ~QuartcEndpoint() = default;
@@ -58,7 +60,8 @@
// Implementation of QuartcEndpoint which immediately (but asynchronously)
// creates a session by scheduling a QuicAlarm. Only suitable for use with the
// client perspective.
-class QuartcClientEndpoint : public QuartcEndpoint {
+class QuartcClientEndpoint : public QuartcEndpoint,
+ public QuartcSession::Delegate {
public:
// |alarm_factory|, |clock|, and |delegate| are owned by the caller and must
// outlive the endpoint.
@@ -66,13 +69,26 @@
QuicAlarmFactory* alarm_factory,
const QuicClock* clock,
QuicRandom* random,
- Delegate* delegate,
+ QuartcEndpoint::Delegate* delegate,
const QuartcSessionConfig& config,
QuicStringPiece serialized_server_config,
std::unique_ptr<QuicVersionManager> version_manager = nullptr);
void Connect(QuartcPacketTransport* packet_transport) override;
+ // QuartcSession::Delegate overrides.
+ void OnCryptoHandshakeComplete() override;
+ void OnConnectionWritable() override;
+ void OnIncomingStream(QuartcStream* stream) override;
+ void OnCongestionControlChange(QuicBandwidth bandwidth_estimate,
+ QuicBandwidth pacing_rate,
+ QuicTime::Delta latest_rtt) override;
+ void OnConnectionClosed(QuicErrorCode error_code,
+ const std::string& error_details,
+ ConnectionCloseSource source) override;
+ void OnMessageReceived(QuicStringPiece message) override;
+ void OnMessageSent(int64_t datagram_id) override;
+
private:
friend class CreateSessionDelegate;
class CreateSessionDelegate : public QuicAlarm::Delegate {
@@ -104,6 +120,18 @@
// Version manager. May be injected to control version negotiation in tests.
std::unique_ptr<QuicVersionManager> version_manager_;
+ // Versions to be used when the next session is created. The session will
+ // choose one of these versions for its connection attempt.
+ //
+ // If the connection does not succeed, the client session MAY try again using
+ // another version from this list, or it MAY simply fail with a
+ // QUIC_INVALID_VERSION error. The latter occurs when it is not possible to
+ // upgrade a connection in-place (for example, if the way stream ids are
+ // allocated changes between versions). This failure mode is handled by
+ // narrowing |current_versions_| to one of that is mutually-supported and
+ // reconnecting (with a new session).
+ ParsedQuicVersionVector current_versions_;
+
// Alarm for creating sessions asynchronously. The alarm is set when
// Connect() is called. When it fires, the endpoint creates a session and
// calls the delegate.
diff --git a/quic/quartc/quartc_endpoint_test.cc b/quic/quartc/quartc_endpoint_test.cc
index 567ccdd..5f8c25d 100644
--- a/quic/quartc/quartc_endpoint_test.cc
+++ b/quic/quartc/quartc_endpoint_test.cc
@@ -30,18 +30,16 @@
&server_transport_,
QuicBandwidth::FromKBitsPerSecond(10000),
QuicTime::Delta::FromMilliseconds(1)),
- server_session_delegate_(&server_stream_delegate_,
- simulator_.GetClock()),
- server_endpoint_delegate_(&server_session_delegate_),
+ server_endpoint_delegate_(&server_stream_delegate_,
+ simulator_.GetClock()),
server_endpoint_(QuicMakeUnique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
simulator_.GetRandomGenerator(),
&server_endpoint_delegate_,
QuartcSessionConfig())),
- client_session_delegate_(&client_stream_delegate_,
- simulator_.GetClock()),
- client_endpoint_delegate_(&client_session_delegate_),
+ client_endpoint_delegate_(&client_stream_delegate_,
+ simulator_.GetClock()),
client_endpoint_(QuicMakeUnique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
@@ -57,13 +55,11 @@
simulator::SymmetricLink client_server_link_;
FakeQuartcStreamDelegate server_stream_delegate_;
- FakeQuartcSessionDelegate server_session_delegate_;
FakeQuartcEndpointDelegate server_endpoint_delegate_;
std::unique_ptr<QuartcServerEndpoint> server_endpoint_;
FakeQuartcStreamDelegate client_stream_delegate_;
- FakeQuartcSessionDelegate client_session_delegate_;
FakeQuartcEndpointDelegate client_endpoint_delegate_;
std::unique_ptr<QuartcClientEndpoint> client_endpoint_;
@@ -215,5 +211,57 @@
EXPECT_EQ(client_endpoint_delegate_.session()->error(), QUIC_INVALID_VERSION);
}
+// Tests that the client endpoint can create a new session in order to continue
+// version negotiation.
+TEST_F(QuartcEndpointTest,
+ QUIC_TEST_DISABLED_IN_CHROME(CreatesNewSessionWhenRequired)) {
+ // Setting this flag to true requires the client to create a new session when
+ // version negotiation fails.
+ SetQuicReloadableFlag(quic_no_client_conn_ver_negotiation, true);
+
+ // Note: for this test, we need support for two versions. Which two shouldn't
+ // matter, but they must be enabled so that the version manager doesn't filter
+ // them out.
+ SetQuicReloadableFlag(quic_enable_version_46, true);
+
+ // Reset the client endpoint to prefer version 46 but also be capable of
+ // speaking version 43.
+ ParsedQuicVersionVector client_versions;
+ client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_46});
+ client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
+ client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ simulator_.GetAlarmFactory(), simulator_.GetClock(),
+ simulator_.GetRandomGenerator(), &client_endpoint_delegate_,
+ QuartcSessionConfig(),
+ /*serialized_server_config=*/"",
+ QuicMakeUnique<QuicVersionManager>(client_versions));
+
+ // Reset the server endpoint to only speak version 43.
+ ParsedQuicVersionVector server_versions;
+ server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
+ server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ simulator_.GetAlarmFactory(), simulator_.GetClock(),
+ simulator_.GetRandomGenerator(), &server_endpoint_delegate_,
+ QuartcSessionConfig(),
+ QuicMakeUnique<QuicVersionManager>(server_versions));
+
+ // The endpoints should be able to establish a connection using version 46.
+ server_endpoint_->Connect(&server_transport_);
+ client_endpoint_->Connect(&client_transport_);
+
+ ASSERT_TRUE(simulator_.RunUntil([this] {
+ return client_endpoint_delegate_.session() != nullptr &&
+ client_endpoint_delegate_.session()->IsEncryptionEstablished() &&
+ server_endpoint_delegate_.session() != nullptr &&
+ server_endpoint_delegate_.session()->IsEncryptionEstablished();
+ }));
+ EXPECT_EQ(client_endpoint_delegate_.session()->connection()->version(),
+ server_versions[0]);
+ EXPECT_EQ(server_endpoint_delegate_.session()->connection()->version(),
+ server_versions[0]);
+
+ EXPECT_EQ(2, client_endpoint_delegate_.num_sessions_created());
+}
+
} // namespace
} // namespace quic
diff --git a/quic/quartc/quartc_factory.cc b/quic/quartc/quartc_factory.cc
index 5b83a46..06871a2 100644
--- a/quic/quartc/quartc_factory.cc
+++ b/quic/quartc/quartc_factory.cc
@@ -71,16 +71,6 @@
SetQuicFlag(FLAGS_quic_buffered_data_threshold,
std::numeric_limits<int>::max());
- // TODO(b/117157454): Perform version negotiation for Quartc outside of
- // QuicSession/QuicConnection. Currently default of
- // gfe2_restart_flag_quic_no_server_conn_ver_negotiation2 is false,
- // but we fail blueprint test that sets all QUIC flags to true.
- //
- // Forcing flag to false to pass blueprint tests, but eventually we'll have
- // to implement negotiation outside of QuicConnection.
- SetQuicRestartFlag(quic_no_server_conn_ver_negotiation2, false);
- SetQuicReloadableFlag(quic_no_client_conn_ver_negotiation, false);
-
// Enable and request QUIC to include receive timestamps in ACK frames.
SetQuicReloadableFlag(quic_send_timestamps, true);
diff --git a/quic/quartc/quartc_fakes.h b/quic/quartc/quartc_fakes.h
index 7048a5e..13b65b1 100644
--- a/quic/quartc/quartc_fakes.h
+++ b/quic/quartc/quartc_fakes.h
@@ -18,37 +18,17 @@
class FakeQuartcEndpointDelegate : public QuartcEndpoint::Delegate {
public:
- explicit FakeQuartcEndpointDelegate(QuartcSession::Delegate* session_delegate)
- : session_delegate_(session_delegate) {}
+ explicit FakeQuartcEndpointDelegate(QuartcStream::Delegate* stream_delegate,
+ const QuicClock* clock)
+ : stream_delegate_(stream_delegate), clock_(clock) {}
void OnSessionCreated(QuartcSession* session) override {
- CHECK_EQ(session_, nullptr);
CHECK_NE(session, nullptr);
session_ = session;
- session_->SetDelegate(session_delegate_);
session_->StartCryptoHandshake();
+ ++num_sessions_created_;
}
- void OnConnectError(QuicErrorCode error,
- const std::string& error_details) override {
- QUIC_LOG(FATAL)
- << "Unexpected error during QuartcEndpoint::Connect(); error=" << error
- << ", error_details=" << error_details;
- }
-
- QuartcSession* session() { return session_; }
-
- private:
- QuartcSession::Delegate* session_delegate_;
- QuartcSession* session_ = nullptr;
-};
-
-class FakeQuartcSessionDelegate : public QuartcSession::Delegate {
- public:
- explicit FakeQuartcSessionDelegate(QuartcStream::Delegate* stream_delegate,
- const QuicClock* clock)
- : stream_delegate_(stream_delegate), clock_(clock) {}
-
void OnConnectionWritable() override {
QUIC_LOG(INFO) << "Connection writable!";
if (!writable_time_.IsInitialized()) {
@@ -87,6 +67,10 @@
QuicBandwidth pacing_rate,
QuicTime::Delta latest_rtt) override {}
+ QuartcSession* session() { return session_; }
+
+ int num_sessions_created() const { return num_sessions_created_; }
+
QuartcStream* last_incoming_stream() const { return last_incoming_stream_; }
// Returns all received messages.
@@ -104,6 +88,12 @@
QuicTime crypto_handshake_time() const { return crypto_handshake_time_; }
private:
+ // Current session.
+ QuartcSession* session_ = nullptr;
+
+ // Number of new sessions created by the endpoint.
+ int num_sessions_created_ = 0;
+
QuartcStream* last_incoming_stream_;
std::vector<std::string> incoming_messages_;
std::vector<int64_t> sent_datagram_ids_;
diff --git a/quic/quartc/quartc_session_test.cc b/quic/quartc/quartc_session_test.cc
index e150e03..87174dc 100644
--- a/quic/quartc/quartc_session_test.cc
+++ b/quic/quartc/quartc_session_test.cc
@@ -61,29 +61,25 @@
QuicBandwidth::FromKBitsPerSecond(10 * 1000), kPropagationDelay);
client_stream_delegate_ = QuicMakeUnique<FakeQuartcStreamDelegate>();
- client_session_delegate_ = QuicMakeUnique<FakeQuartcSessionDelegate>(
+ client_session_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
client_stream_delegate_.get(), simulator_.GetClock());
- client_endpoint_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
- client_session_delegate_.get());
server_stream_delegate_ = QuicMakeUnique<FakeQuartcStreamDelegate>();
- server_session_delegate_ = QuicMakeUnique<FakeQuartcSessionDelegate>(
+ server_session_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
server_stream_delegate_.get(), simulator_.GetClock());
- server_endpoint_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
- server_session_delegate_.get());
// No 0-rtt setup, because server config is empty.
// CannotCreateDataStreamBeforeHandshake depends on 1-rtt setup.
if (create_client_endpoint) {
client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
- simulator_.GetRandomGenerator(), client_endpoint_delegate_.get(),
+ simulator_.GetRandomGenerator(), client_session_delegate_.get(),
quic::QuartcSessionConfig(),
/*serialized_server_config=*/"");
}
server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
- simulator_.GetRandomGenerator(), server_endpoint_delegate_.get(),
+ simulator_.GetRandomGenerator(), server_session_delegate_.get(),
quic::QuartcSessionConfig());
}
@@ -99,12 +95,12 @@
client_endpoint_->Connect(client_transport_.get());
CHECK(simulator_.RunUntil([this] {
- return client_endpoint_delegate_->session() != nullptr &&
- server_endpoint_delegate_->session() != nullptr;
+ return client_session_delegate_->session() != nullptr &&
+ server_session_delegate_->session() != nullptr;
}));
- client_peer_ = client_endpoint_delegate_->session();
- server_peer_ = server_endpoint_delegate_->session();
+ client_peer_ = client_session_delegate_->session();
+ server_peer_ = server_session_delegate_->session();
}
// Runs all tasks scheduled in the next 200 ms.
@@ -214,11 +210,11 @@
QuartcSession* const peer_sending =
direction_from_server ? server_peer_ : client_peer_;
- FakeQuartcSessionDelegate* const delegate_receiving =
+ FakeQuartcEndpointDelegate* const delegate_receiving =
direction_from_server ? client_session_delegate_.get()
: server_session_delegate_.get();
- FakeQuartcSessionDelegate* const delegate_sending =
+ FakeQuartcEndpointDelegate* const delegate_sending =
direction_from_server ? server_session_delegate_.get()
: client_session_delegate_.get();
@@ -299,11 +295,9 @@
std::unique_ptr<simulator::SymmetricLink> client_server_link_;
std::unique_ptr<FakeQuartcStreamDelegate> client_stream_delegate_;
- std::unique_ptr<FakeQuartcSessionDelegate> client_session_delegate_;
- std::unique_ptr<FakeQuartcEndpointDelegate> client_endpoint_delegate_;
+ std::unique_ptr<FakeQuartcEndpointDelegate> client_session_delegate_;
std::unique_ptr<FakeQuartcStreamDelegate> server_stream_delegate_;
- std::unique_ptr<FakeQuartcSessionDelegate> server_session_delegate_;
- std::unique_ptr<FakeQuartcEndpointDelegate> server_endpoint_delegate_;
+ std::unique_ptr<FakeQuartcEndpointDelegate> server_session_delegate_;
std::unique_ptr<QuartcClientEndpoint> client_endpoint_;
std::unique_ptr<QuartcServerEndpoint> server_endpoint_;
@@ -537,7 +531,7 @@
client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
- simulator_.GetRandomGenerator(), client_endpoint_delegate_.get(),
+ simulator_.GetRandomGenerator(), client_session_delegate_.get(),
QuartcSessionConfig(),
// This is the key line here. It passes through the server config
// from the server to the client.
@@ -549,8 +543,8 @@
// client session should be created, but server won't be created yet.
simulator_.RunFor(QuicTime::Delta::FromMilliseconds(1));
- client_peer_ = client_endpoint_delegate_->session();
- server_peer_ = server_endpoint_delegate_->session();
+ client_peer_ = client_session_delegate_->session();
+ server_peer_ = server_session_delegate_->session();
ASSERT_NE(client_peer_, nullptr);
ASSERT_EQ(server_peer_, nullptr);
diff --git a/quic/quartc/test/quartc_peer.cc b/quic/quartc/test/quartc_peer.cc
index 6857858..761349e 100644
--- a/quic/quartc/test/quartc_peer.cc
+++ b/quic/quartc/test/quartc_peer.cc
@@ -46,7 +46,6 @@
void QuartcPeer::OnSessionCreated(QuartcSession* session) {
session_ = session;
- session_->SetDelegate(this);
session_->StartCryptoHandshake();
QuicByteCount largest_message_payload =
@@ -65,13 +64,6 @@
}
}
-void QuartcPeer::OnConnectError(QuicErrorCode error,
- const std::string& error_details) {
- QUIC_LOG(WARNING) << "Connect failed, error=" << error
- << ", details=" << error_details;
- SetEnabled(false);
-}
-
void QuartcPeer::OnCryptoHandshakeComplete() {
SetEnabled(true);
}
diff --git a/quic/quartc/test/quartc_peer.h b/quic/quartc/test/quartc_peer.h
index 65d85fa..b96f488 100644
--- a/quic/quartc/test/quartc_peer.h
+++ b/quic/quartc/test/quartc_peer.h
@@ -39,7 +39,6 @@
// datagram frames. It also adjusts the bitrate of each source to fit within
// the bandwidth available to the session.
class QuartcPeer : public QuartcEndpoint::Delegate,
- public QuartcSession::Delegate,
public QuartcDataSource::Delegate {
public:
// Creates a QuartcPeer that sends data from a set of sources described by
@@ -73,8 +72,6 @@
// QuartcEndpoint::Delegate overrides.
void OnSessionCreated(QuartcSession* session) override;
- void OnConnectError(QuicErrorCode error,
- const std::string& error_details) override;
// QuartcSession::Delegate overrides.
void OnCryptoHandshakeComplete() override;
diff --git a/quic/quartc/test/quic_trace_interceptor.cc b/quic/quartc/test/quic_trace_interceptor.cc
index c2fa6ec..741c542 100644
--- a/quic/quartc/test/quic_trace_interceptor.cc
+++ b/quic/quartc/test/quic_trace_interceptor.cc
@@ -33,9 +33,38 @@
delegate_->OnSessionCreated(session);
}
-void QuicTraceInterceptor::OnConnectError(QuicErrorCode error,
- const std::string& details) {
- delegate_->OnConnectError(error, details);
+void QuicTraceInterceptor::OnCryptoHandshakeComplete() {
+ delegate_->OnCryptoHandshakeComplete();
+}
+
+void QuicTraceInterceptor::OnConnectionWritable() {
+ delegate_->OnConnectionWritable();
+}
+
+void QuicTraceInterceptor::OnIncomingStream(QuartcStream* stream) {
+ delegate_->OnIncomingStream(stream);
+}
+
+void QuicTraceInterceptor::OnCongestionControlChange(
+ QuicBandwidth bandwidth_estimate,
+ QuicBandwidth pacing_rate,
+ QuicTime::Delta latest_rtt) {
+ delegate_->OnCongestionControlChange(bandwidth_estimate, pacing_rate,
+ latest_rtt);
+}
+
+void QuicTraceInterceptor::OnConnectionClosed(QuicErrorCode error_code,
+ const std::string& error_details,
+ ConnectionCloseSource source) {
+ delegate_->OnConnectionClosed(error_code, error_details, source);
+}
+
+void QuicTraceInterceptor::OnMessageReceived(QuicStringPiece message) {
+ delegate_->OnMessageReceived(message);
+}
+
+void QuicTraceInterceptor::OnMessageSent(int64_t datagram_id) {
+ delegate_->OnMessageSent(datagram_id);
}
void QuicTraceInterceptor::SetDelegate(QuartcEndpoint::Delegate* delegate) {
diff --git a/quic/quartc/test/quic_trace_interceptor.h b/quic/quartc/test/quic_trace_interceptor.h
index bb731b1..ee79d1e 100644
--- a/quic/quartc/test/quic_trace_interceptor.h
+++ b/quic/quartc/test/quic_trace_interceptor.h
@@ -28,7 +28,17 @@
// QuartcEndpointIntercept overrides.
void OnSessionCreated(QuartcSession* session) override;
- void OnConnectError(QuicErrorCode error, const std::string& details) override;
+ void OnCryptoHandshakeComplete() override;
+ void OnConnectionWritable() override;
+ void OnIncomingStream(QuartcStream* stream) override;
+ void OnCongestionControlChange(QuicBandwidth bandwidth_estimate,
+ QuicBandwidth pacing_rate,
+ QuicTime::Delta latest_rtt) override;
+ void OnConnectionClosed(QuicErrorCode error_code,
+ const std::string& error_details,
+ ConnectionCloseSource source) override;
+ void OnMessageReceived(QuicStringPiece message) override;
+ void OnMessageSent(int64_t datagram_id) override;
void SetDelegate(QuartcEndpoint::Delegate* delegate) override;
private: