Add ShouldUpdateExpectedConnectionIdLength to QuicFramer

ShouldUpdateExpectedConnectionIdLength allows clients of QuicDispatcher like Quartc to have the QuicFramer owned by the QuicDispatcher dynamically change its expected connection ID length based on received long header packets. This will allow quartc to migrate to 0-length connection IDs.

gfe-relnote: refactor-only, no behavior change, not flag protected
PiperOrigin-RevId: 237882443
Change-Id: If7a49b092e1ff29fec740a18bbb7c5b78d749d62
diff --git a/quic/quartc/quartc_factory.cc b/quic/quartc/quartc_factory.cc
index 803122a..8efa544 100644
--- a/quic/quartc/quartc_factory.cc
+++ b/quic/quartc/quartc_factory.cc
@@ -197,13 +197,12 @@
     QuartcPacketWriter* packet_writer) {
   // |dummy_id| and |dummy_address| are used because Quartc network layer will
   // not use these two.
-    char connection_id_bytes[sizeof(uint64_t)] = {};
-    QuicConnectionId dummy_id = QuicConnectionId(
-        static_cast<char*>(connection_id_bytes), sizeof(connection_id_bytes));
-    QuicSocketAddress dummy_address(QuicIpAddress::Any4(), /*port=*/0);
-    return quic::CreateQuicConnection(
-        dummy_id, dummy_address, connection_helper_.get(), alarm_factory_,
-        packet_writer, perspective, supported_versions);
+  QuicConnectionId dummy_id = QuicUtils::CreateZeroConnectionId(
+      supported_versions[0].transport_version);
+  QuicSocketAddress dummy_address(QuicIpAddress::Any4(), /*port=*/0);
+  return quic::CreateQuicConnection(
+      dummy_id, dummy_address, connection_helper_.get(), alarm_factory_,
+      packet_writer, perspective, supported_versions);
 }
 
 std::unique_ptr<QuicConnection> CreateQuicConnection(