Fix QUIC warnings in preparation for enabling them

gfe-relnote: n/a, compilation-only change
PiperOrigin-RevId: 253893322
Change-Id: I15917a1c5b325922850086277cfad5e3b4da20a4
diff --git a/quic/quartc/counting_packet_filter.h b/quic/quartc/counting_packet_filter.h
index 32feffc..4c7c270 100644
--- a/quic/quartc/counting_packet_filter.h
+++ b/quic/quartc/counting_packet_filter.h
@@ -25,7 +25,7 @@
   void set_packets_to_drop(int count) { packets_to_drop_ = count; }
 
  protected:
-  bool FilterPacket(const simulator::Packet& packet) override {
+  bool FilterPacket(const simulator::Packet& /*packet*/) override {
     if (packets_to_drop_ > 0) {
       --packets_to_drop_;
       return false;
diff --git a/quic/quartc/quartc_crypto_helpers.cc b/quic/quartc/quartc_crypto_helpers.cc
index dc7b973..fd579ba 100644
--- a/quic/quartc/quartc_crypto_helpers.cc
+++ b/quic/quartc/quartc_crypto_helpers.cc
@@ -11,9 +11,9 @@
 
 void DummyProofSource::GetProof(const QuicSocketAddress& server_address,
                                 const std::string& hostname,
-                                const std::string& server_config,
-                                QuicTransportVersion transport_version,
-                                QuicStringPiece chlo_hash,
+                                const std::string& /*server_config*/,
+                                QuicTransportVersion /*transport_version*/,
+                                QuicStringPiece /*chlo_hash*/,
                                 std::unique_ptr<Callback> callback) {
   QuicReferenceCountedPointer<ProofSource::Chain> chain =
       GetCertChain(server_address, hostname);
@@ -24,8 +24,8 @@
 }
 
 QuicReferenceCountedPointer<DummyProofSource::Chain>
-DummyProofSource::GetCertChain(const QuicSocketAddress& server_address,
-                               const std::string& hostname) {
+DummyProofSource::GetCertChain(const QuicSocketAddress& /*server_address*/,
+                               const std::string& /*hostname*/) {
   std::vector<std::string> certs;
   certs.push_back(kDummyCertName);
   return QuicReferenceCountedPointer<ProofSource::Chain>(
@@ -33,39 +33,39 @@
 }
 
 void DummyProofSource::ComputeTlsSignature(
-    const QuicSocketAddress& server_address,
-    const std::string& hostname,
-    uint16_t signature_algorithm,
-    QuicStringPiece in,
+    const QuicSocketAddress& /*server_address*/,
+    const std::string& /*hostname*/,
+    uint16_t /*signature_algorithm*/,
+    QuicStringPiece /*in*/,
     std::unique_ptr<SignatureCallback> callback) {
   callback->Run(true, "Dummy signature");
 }
 
 QuicAsyncStatus InsecureProofVerifier::VerifyProof(
-    const std::string& hostname,
-    const uint16_t port,
-    const std::string& server_config,
-    QuicTransportVersion transport_version,
-    QuicStringPiece chlo_hash,
-    const std::vector<std::string>& certs,
-    const std::string& cert_sct,
-    const std::string& signature,
-    const ProofVerifyContext* context,
-    std::string* error_details,
-    std::unique_ptr<ProofVerifyDetails>* verify_details,
-    std::unique_ptr<ProofVerifierCallback> callback) {
+    const std::string& /*hostname*/,
+    const uint16_t /*port*/,
+    const std::string& /*server_config*/,
+    QuicTransportVersion /*transport_version*/,
+    QuicStringPiece /*chlo_hash*/,
+    const std::vector<std::string>& /*certs*/,
+    const std::string& /*cert_sct*/,
+    const std::string& /*signature*/,
+    const ProofVerifyContext* /*context*/,
+    std::string* /*error_details*/,
+    std::unique_ptr<ProofVerifyDetails>* /*verify_details*/,
+    std::unique_ptr<ProofVerifierCallback> /*callback*/) {
   return QUIC_SUCCESS;
 }
 
 QuicAsyncStatus InsecureProofVerifier::VerifyCertChain(
-    const std::string& hostname,
-    const std::vector<std::string>& certs,
-    const std::string& ocsp_response,
-    const std::string& cert_sct,
-    const ProofVerifyContext* context,
-    std::string* error_details,
-    std::unique_ptr<ProofVerifyDetails>* details,
-    std::unique_ptr<ProofVerifierCallback> callback) {
+    const std::string& /*hostname*/,
+    const std::vector<std::string>& /*certs*/,
+    const std::string& /*ocsp_response*/,
+    const std::string& /*cert_sct*/,
+    const ProofVerifyContext* /*context*/,
+    std::string* /*error_details*/,
+    std::unique_ptr<ProofVerifyDetails>* /*details*/,
+    std::unique_ptr<ProofVerifierCallback> /*callback*/) {
   return QUIC_SUCCESS;
 }
 
@@ -75,19 +75,19 @@
 }
 
 QuicConnectionId QuartcCryptoServerStreamHelper::GenerateConnectionIdForReject(
-    QuicTransportVersion version,
-    QuicConnectionId connection_id) const {
+    QuicTransportVersion /*version*/,
+    QuicConnectionId /*connection_id*/) const {
   // TODO(b/124399417):  Request a zero-length connection id here when the QUIC
   // server perspective supports it.
   return QuicUtils::CreateRandomConnectionId();
 }
 
 bool QuartcCryptoServerStreamHelper::CanAcceptClientHello(
-    const CryptoHandshakeMessage& message,
-    const QuicSocketAddress& client_address,
-    const QuicSocketAddress& peer_address,
-    const QuicSocketAddress& self_address,
-    std::string* error_details) const {
+    const CryptoHandshakeMessage& /*message*/,
+    const QuicSocketAddress& /*client_address*/,
+    const QuicSocketAddress& /*peer_address*/,
+    const QuicSocketAddress& /*self_address*/,
+    std::string* /*error_details*/) const {
   return true;
 }
 
diff --git a/quic/quartc/quartc_dispatcher.cc b/quic/quartc/quartc_dispatcher.cc
index 240ddc1..a9d5510 100644
--- a/quic/quartc/quartc_dispatcher.cc
+++ b/quic/quartc/quartc_dispatcher.cc
@@ -53,7 +53,7 @@
 QuartcSession* QuartcDispatcher::CreateQuicSession(
     QuicConnectionId connection_id,
     const QuicSocketAddress& client_address,
-    QuicStringPiece alpn,
+    QuicStringPiece /*alpn*/,
     const ParsedQuicVersion& version) {
   // Make our expected connection ID non-mutable since we have a connection.
   SetShouldUpdateExpectedServerConnectionIdLength(false);
diff --git a/quic/quartc/quartc_fakes.h b/quic/quartc/quartc_fakes.h
index be45400..8b86064 100644
--- a/quic/quartc/quartc_fakes.h
+++ b/quic/quartc/quartc_fakes.h
@@ -43,9 +43,9 @@
   }
 
   // Called when connection closes locally, or remotely by peer.
-  void OnConnectionClosed(QuicErrorCode error_code,
-                          const std::string& error_details,
-                          ConnectionCloseSource source) override {
+  void OnConnectionClosed(QuicErrorCode /*error_code*/,
+                          const std::string& /*error_details*/,
+                          ConnectionCloseSource /*source*/) override {
     connected_ = false;
   }
 
@@ -73,9 +73,9 @@
     lost_datagram_ids_.push_back(datagram_id);
   }
 
-  void OnCongestionControlChange(QuicBandwidth bandwidth_estimate,
-                                 QuicBandwidth pacing_rate,
-                                 QuicTime::Delta latest_rtt) override {}
+  void OnCongestionControlChange(QuicBandwidth /*bandwidth_estimate*/,
+                                 QuicBandwidth /*pacing_rate*/,
+                                 QuicTime::Delta /*latest_rtt*/) override {}
 
   QuartcSession* session() { return session_; }
 
@@ -131,7 +131,7 @@
   size_t OnReceived(QuartcStream* stream,
                     iovec* iov,
                     size_t iov_length,
-                    bool fin) override {
+                    bool /*fin*/) override {
     size_t bytes_consumed = 0;
     for (size_t i = 0; i < iov_length; ++i) {
       received_data_[stream->id()] += std::string(
@@ -145,7 +145,7 @@
     errors_[stream->id()] = stream->stream_error();
   }
 
-  void OnBufferChanged(QuartcStream* stream) override {}
+  void OnBufferChanged(QuartcStream* /*stream*/) override {}
 
   bool has_data() { return !received_data_.empty(); }
   std::map<QuicStreamId, std::string> data() { return received_data_; }
diff --git a/quic/quartc/quartc_packet_writer.cc b/quic/quartc/quartc_packet_writer.cc
index 64a72a8..223ad3d 100644
--- a/quic/quartc/quartc_packet_writer.cc
+++ b/quic/quartc/quartc_packet_writer.cc
@@ -17,8 +17,8 @@
 WriteResult QuartcPacketWriter::WritePacket(
     const char* buffer,
     size_t buf_len,
-    const QuicIpAddress& self_address,
-    const QuicSocketAddress& peer_address,
+    const QuicIpAddress& /*self_address*/,
+    const QuicSocketAddress& /*peer_address*/,
     PerPacketOptions* options) {
   DCHECK(packet_transport_);
 
@@ -42,7 +42,7 @@
 }
 
 QuicByteCount QuartcPacketWriter::GetMaxPacketSize(
-    const QuicSocketAddress& peer_address) const {
+    const QuicSocketAddress& /*peer_address*/) const {
   return max_packet_size_;
 }
 
@@ -59,8 +59,8 @@
 }
 
 char* QuartcPacketWriter::GetNextWriteLocation(
-    const QuicIpAddress& self_address,
-    const QuicSocketAddress& peer_address) {
+    const QuicIpAddress& /*self_address*/,
+    const QuicSocketAddress& /*peer_address*/) {
   return nullptr;
 }
 
diff --git a/quic/quartc/quartc_session.cc b/quic/quartc/quartc_session.cc
index ac908f9..e332613 100644
--- a/quic/quartc/quartc_session.cc
+++ b/quic/quartc/quartc_session.cc
@@ -184,7 +184,7 @@
   }
 }
 
-void QuartcSession::OnCongestionWindowChange(QuicTime now) {
+void QuartcSession::OnCongestionWindowChange(QuicTime /*now*/) {
   DCHECK(session_delegate_);
   const RttStats* rtt_stats = connection_->sent_packet_manager().GetRttStats();
 
@@ -401,12 +401,12 @@
 }
 
 void QuartcClientSession::OnProofValid(
-    const QuicCryptoClientConfig::CachedState& cached) {
+    const QuicCryptoClientConfig::CachedState& /*cached*/) {
   // TODO(zhihuang): Handle the proof verification.
 }
 
 void QuartcClientSession::OnProofVerifyDetailsAvailable(
-    const ProofVerifyDetails& verify_details) {
+    const ProofVerifyDetails& /*verify_details*/) {
   // TODO(zhihuang): Handle the proof verification.
 }
 
diff --git a/quic/quartc/quartc_session_test.cc b/quic/quartc/quartc_session_test.cc
index 1bd0828..8bb9ad1 100644
--- a/quic/quartc/quartc_session_test.cc
+++ b/quic/quartc/quartc_session_test.cc
@@ -90,8 +90,9 @@
 
   // Note that input session config will apply to both server and client.
   // Perspective and packet_transport will be overwritten.
-  void CreateClientAndServerSessions(const QuartcSessionConfig& session_config,
-                                     bool init = true) {
+  void CreateClientAndServerSessions(
+      const QuartcSessionConfig& /*session_config*/,
+      bool init = true) {
     if (init) {
       Init();
     }
diff --git a/quic/quartc/quartc_stream.cc b/quic/quartc/quartc_stream.cc
index 80bc3fc..1250185 100644
--- a/quic/quartc/quartc_stream.cc
+++ b/quic/quartc/quartc_stream.cc
@@ -66,9 +66,10 @@
 }
 
 void QuartcStream::OnDataBuffered(
-    QuicStreamOffset offset,
-    QuicByteCount data_length,
-    const QuicReferenceCountedPointer<QuicAckListenerInterface>& ack_listener) {
+    QuicStreamOffset /*offset*/,
+    QuicByteCount /*data_length*/,
+    const QuicReferenceCountedPointer<
+        QuicAckListenerInterface>& /*ack_listener*/) {
   DCHECK(delegate_);
   delegate_->OnBufferChanged(this);
 }
diff --git a/quic/quartc/quartc_stream_test.cc b/quic/quartc/quartc_stream_test.cc
index 5ee2d6f..be23b75 100644
--- a/quic/quartc/quartc_stream_test.cc
+++ b/quic/quartc/quartc_stream_test.cc
@@ -62,7 +62,7 @@
 
   // Writes outgoing data from QuicStream to a string.
   QuicConsumedData WritevData(QuicStream* stream,
-                              QuicStreamId id,
+                              QuicStreamId /*id*/,
                               size_t write_length,
                               QuicStreamOffset offset,
                               StreamSendingState state) override {
@@ -82,11 +82,11 @@
     return QuicConsumedData(write_length, state != StreamSendingState::NO_FIN);
   }
 
-  QuartcStream* CreateIncomingStream(QuicStreamId id) override {
+  QuartcStream* CreateIncomingStream(QuicStreamId /*id*/) override {
     return nullptr;
   }
 
-  QuartcStream* CreateIncomingStream(PendingStream* pending) override {
+  QuartcStream* CreateIncomingStream(PendingStream* /*pending*/) override {
     return nullptr;
   }
 
@@ -97,9 +97,9 @@
   }
 
   // Called by QuicStream when they want to close stream.
-  void SendRstStream(QuicStreamId id,
-                     QuicRstStreamErrorCode error,
-                     QuicStreamOffset bytes_written) override {}
+  void SendRstStream(QuicStreamId /*id*/,
+                     QuicRstStreamErrorCode /*error*/,
+                     QuicStreamOffset /*bytes_written*/) override {}
 
   // Sets whether data is written to buffer, or else if this is write blocked.
   void set_writable(bool writable) { writable_ = writable; }
@@ -131,11 +131,11 @@
   DummyPacketWriter() {}
 
   // QuicPacketWriter overrides.
-  WriteResult WritePacket(const char* buffer,
-                          size_t buf_len,
-                          const QuicIpAddress& self_address,
-                          const QuicSocketAddress& peer_address,
-                          PerPacketOptions* options) override {
+  WriteResult WritePacket(const char* /*buffer*/,
+                          size_t /*buf_len*/,
+                          const QuicIpAddress& /*self_address*/,
+                          const QuicSocketAddress& /*peer_address*/,
+                          PerPacketOptions* /*options*/) override {
     return WriteResult(WRITE_STATUS_ERROR, 0);
   }
 
@@ -144,7 +144,7 @@
   void SetWritable() override {}
 
   QuicByteCount GetMaxPacketSize(
-      const QuicSocketAddress& peer_address) const override {
+      const QuicSocketAddress& /*peer_address*/) const override {
     return 0;
   }
 
@@ -152,8 +152,9 @@
 
   bool IsBatchMode() const override { return false; }
 
-  char* GetNextWriteLocation(const QuicIpAddress& self_address,
-                             const QuicSocketAddress& peer_address) override {
+  char* GetNextWriteLocation(
+      const QuicIpAddress& /*self_address*/,
+      const QuicSocketAddress& /*peer_address*/) override {
     return nullptr;
   }
 
@@ -173,7 +174,7 @@
   size_t OnReceived(QuartcStream* stream,
                     iovec* iov,
                     size_t iov_length,
-                    bool fin) override {
+                    bool /*fin*/) override {
     EXPECT_EQ(id_, stream->id());
     EXPECT_EQ(stream->ReadOffset(), read_buffer_->size());
     size_t bytes_consumed = 0;
@@ -185,7 +186,7 @@
     return bytes_consumed;
   }
 
-  void OnClose(QuartcStream* stream) override { closed_ = true; }
+  void OnClose(QuartcStream* /*stream*/) override { closed_ = true; }
 
   bool closed() { return closed_; }
 
diff --git a/quic/quartc/test/quartc_peer.cc b/quic/quartc/test/quartc_peer.cc
index 761349e..0a24187 100644
--- a/quic/quartc/test/quartc_peer.cc
+++ b/quic/quartc/test/quartc_peer.cc
@@ -78,7 +78,7 @@
 
 void QuartcPeer::OnCongestionControlChange(QuicBandwidth bandwidth_estimate,
                                            QuicBandwidth pacing_rate,
-                                           QuicTime::Delta latest_rtt) {
+                                           QuicTime::Delta /*latest_rtt*/) {
   // Note: this is fairly crude rate adaptation and makes no effort to account
   // for overhead.  The congestion controller is assumed to account for this.
   // It may do so by detecting overuse and pushing back on its bandwidth
@@ -92,7 +92,7 @@
 
 void QuartcPeer::OnConnectionClosed(QuicErrorCode error_code,
                                     const std::string& error_details,
-                                    ConnectionCloseSource source) {
+                                    ConnectionCloseSource /*source*/) {
   QUIC_LOG(INFO) << "Connection closed, error=" << error_code
                  << ", details=" << error_details;
   SetEnabled(false);
diff --git a/quic/quartc/test/quartc_peer.h b/quic/quartc/test/quartc_peer.h
index 39dd148..2eab393 100644
--- a/quic/quartc/test/quartc_peer.h
+++ b/quic/quartc/test/quartc_peer.h
@@ -84,10 +84,10 @@
                           const std::string& error_details,
                           ConnectionCloseSource source) override;
   void OnMessageReceived(QuicStringPiece message) override;
-  void OnMessageSent(int64_t datagram_id) override {}
-  void OnMessageAcked(int64_t datagram_id,
-                      QuicTime receive_timestamp) override {}
-  void OnMessageLost(int64_t datagram_id) override {}
+  void OnMessageSent(int64_t /*datagram_id*/) override {}
+  void OnMessageAcked(int64_t /*datagram_id*/,
+                      QuicTime /*receive_timestamp*/) override {}
+  void OnMessageLost(int64_t /*datagram_id*/) override {}
 
   // QuartcDataSource::Delegate overrides.
   void OnDataProduced(const char* data, size_t length) override;
diff --git a/quic/quartc/test/random_delay_link.cc b/quic/quartc/test/random_delay_link.cc
index edd57e3..71e161c 100644
--- a/quic/quartc/test/random_delay_link.cc
+++ b/quic/quartc/test/random_delay_link.cc
@@ -31,7 +31,8 @@
 
 RandomDelayLink::~RandomDelayLink() {}
 
-QuicTime::Delta RandomDelayLink::GetRandomDelay(QuicTime::Delta transfer_time) {
+QuicTime::Delta RandomDelayLink::GetRandomDelay(
+    QuicTime::Delta /*transfer_time*/) {
   // Computes a random delay following an exponential distribution, with median
   // value |median_random_delay_|.  Choose a uniform random value between 1 and
   // kNumBuckets, convert this to an exponential, then scale it such that a
diff --git a/quic/quartc/test/random_packet_filter.cc b/quic/quartc/test/random_packet_filter.cc
index 2fb160e..a40748f 100644
--- a/quic/quartc/test/random_packet_filter.cc
+++ b/quic/quartc/test/random_packet_filter.cc
@@ -12,7 +12,7 @@
                                        Endpoint* endpoint)
     : PacketFilter(simulator, name, endpoint), simulator_(simulator) {}
 
-bool RandomPacketFilter::FilterPacket(const Packet& packet) {
+bool RandomPacketFilter::FilterPacket(const Packet& /*packet*/) {
   uint64_t random = simulator_->GetRandomGenerator()->RandUint64();
   return 100 * static_cast<double>(random) /
              std::numeric_limits<uint64_t>::max() >=