gfe-relnote: (n/a) Change the return type of QuicDispatcher::CreateQuicSession from raw to unique_ptr. No behavior change, not protected.
PiperOrigin-RevId: 285249381
Change-Id: Ia6d129501364dc231f86f4bda2be36ffd848bb93
diff --git a/quic/quartc/quartc_dispatcher.cc b/quic/quartc/quartc_dispatcher.cc
index 57de849..8f0f1c1 100644
--- a/quic/quartc/quartc_dispatcher.cc
+++ b/quic/quartc/quartc_dispatcher.cc
@@ -50,7 +50,7 @@
packet_writer_->SetPacketTransportDelegate(nullptr);
}
-QuartcSession* QuartcDispatcher::CreateQuicSession(
+std::unique_ptr<QuicSession> QuartcDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
const QuicSocketAddress& client_address,
quiche::QuicheStringPiece /*alpn*/,
@@ -60,11 +60,11 @@
std::unique_ptr<QuicConnection> connection = CreateQuicConnection(
connection_id, client_address, helper(), alarm_factory(), writer(),
Perspective::IS_SERVER, ParsedQuicVersionVector{version});
- QuartcSession* session = new QuartcServerSession(
+ auto session = std::make_unique<QuartcServerSession>(
std::move(connection), /*visitor=*/this, config(), GetSupportedVersions(),
helper()->GetClock(), crypto_config(), compressed_certs_cache(),
session_helper());
- delegate_->OnSessionCreated(session);
+ delegate_->OnSessionCreated(session.get());
return session;
}
diff --git a/quic/quartc/quartc_dispatcher.h b/quic/quartc/quartc_dispatcher.h
index b294330..7ac3dae 100644
--- a/quic/quartc/quartc_dispatcher.h
+++ b/quic/quartc/quartc_dispatcher.h
@@ -40,10 +40,11 @@
Delegate* delegate);
~QuartcDispatcher() override;
- QuartcSession* CreateQuicSession(QuicConnectionId server_connection_id,
- const QuicSocketAddress& client_address,
- quiche::QuicheStringPiece alpn,
- const ParsedQuicVersion& version) override;
+ std::unique_ptr<QuicSession> CreateQuicSession(
+ QuicConnectionId server_connection_id,
+ const QuicSocketAddress& client_address,
+ quiche::QuicheStringPiece alpn,
+ const ParsedQuicVersion& version) override;
// TODO(b/124399417): Override GenerateNewServerConnectionId and request a
// zero-length connection id when the QUIC server perspective supports it.