Skip to content

Commit f074333

Browse files
QUICHE teamcopybara-github
authored andcommitted
Fix 13 ClangInliner findings:
* The use of this symbol has been deprecated and marked for inlining. The function being deprecated is down_cast. (13 times) See go/inliner-lsc for more information on why you've received this change and why it is important. This CL looks good? Just LGTM and Approve it! This CL doesn’t look good? This is what you can do: * Revert this CL, by replying "REVERT: <provide reason>" * File a bug under go/inliner-bug for category ClangInliner if there's an issue with the CL content. * File a bug under go/rosie-bug if there's an issue with how the CL was managed. * For all other issues such as the formatting of the CL, please file a bug under go/clrobot-bug. * Revert this CL and not get a CL that cleans up these paths in the future by replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to opt out the respective paths in your CL Robot configuration instead: go/clrobot-opt-out. This CL was generated by CL Robot - a tool that cleans up code findings (go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/METADATA by following go/clrobot#how-to-opt-in. Anything wrong with the signup? File a bug at go/clrobot-bug. #clrobot #base-casts.h Tested: Local presubmit tests passed. PiperOrigin-RevId: 862535221
1 parent ae950ea commit f074333

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

quiche/quic/core/http/end_to_end_test.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class EndToEndTest : public QuicTestWithParam<TestParams> {
481481
return nullptr;
482482
}
483483
EXPECT_EQ(1u, dispatcher->NumSessions());
484-
return static_cast<QuicSpdySession*>(
484+
return absl::static_cast<QuicSpdySession*>(
485485
QuicDispatcherPeer::GetFirstSessionIfAny(dispatcher));
486486
}
487487

@@ -662,7 +662,7 @@ class EndToEndTest : public QuicTestWithParam<TestParams> {
662662
QuicDispatcherPeer::GetAlarmFactory(dispatcher),
663663
std::make_unique<ServerDelegate>(dispatcher));
664664
if (stream_factory_ != nullptr) {
665-
static_cast<QuicTestServer*>(server_thread_->server())
665+
absl::static_cast<QuicTestServer*>(server_thread_->server())
666666
->SetSpdyStreamFactory(stream_factory_);
667667
}
668668

@@ -1057,7 +1057,7 @@ class EndToEndTest : public QuicTestWithParam<TestParams> {
10571057

10581058
QuicConfig PauseServerAndGetLastNegotiatedConfigFromDispatcher() {
10591059
server_thread_->Pause();
1060-
QuicSimpleDispatcher* dispatcher = static_cast<QuicSimpleDispatcher*>(
1060+
QuicSimpleDispatcher* dispatcher = absl::static_cast<QuicSimpleDispatcher*>(
10611061
QuicServerPeer::GetDispatcher(server_thread_->server()));
10621062
std::optional<QuicConfig> config = dispatcher->last_negotiated_config();
10631063
if (!config.has_value()) {
@@ -2389,7 +2389,8 @@ TEST_P(EndToEndTest, QUICHE_SLOW_TEST(AddressTokenNotReusedByClient)) {
23892389
client_->Disconnect();
23902390

23912391
QuicClientSessionCache* session_cache =
2392-
static_cast<QuicClientSessionCache*>(client_crypto_config->session_cache());
2392+
absl::static_cast<QuicClientSessionCache*>(
2393+
client_crypto_config->session_cache());
23932394
ASSERT_TRUE(
23942395
!QuicClientSessionCachePeer::GetToken(session_cache, server_id).empty());
23952396

quiche/quic/core/http/quic_receive_control_stream_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class QuicReceiveControlStreamTest : public QuicTestWithParam<TestParams> {
9292
session_(connection_) {
9393
EXPECT_CALL(session_, OnCongestionWindowChange(_)).Times(AnyNumber());
9494
session_.Initialize();
95-
EXPECT_CALL(
96-
static_cast<const MockQuicCryptoStream&>(*session_.GetCryptoStream()),
97-
encryption_established())
95+
EXPECT_CALL(absl::static_cast<const MockQuicCryptoStream&>(
96+
*session_.GetCryptoStream()),
97+
encryption_established())
9898
.WillRepeatedly(testing::Return(true));
9999
QuicStreamId id = perspective() == Perspective::IS_SERVER
100100
? GetNthClientInitiatedUnidirectionalStreamId(

quiche/quic/core/http/quic_server_session_base_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ TEST_P(QuicServerSessionBaseTest, BandwidthResumptionExperiment) {
668668
QuicTime::Delta::FromSeconds(kNumSecondsPerHour + 1));
669669

670670
QuicCryptoServerStreamBase* crypto_stream =
671-
static_cast<QuicCryptoServerStreamBase*>(
671+
absl::static_cast<QuicCryptoServerStreamBase*>(
672672
QuicSessionPeer::GetMutableCryptoStream(session_.get()));
673673

674674
// No effect if no CachedNetworkParameters provided.
@@ -804,7 +804,8 @@ class StreamMemberLifetimeTest : public QuicServerSessionBaseTest {
804804
}
805805

806806
FakeProofSource* GetFakeProofSource() const {
807-
return static_cast<FakeProofSource*>(crypto_config_peer_.GetProofSource());
807+
return absl::static_cast<FakeProofSource*>(
808+
crypto_config_peer_.GetProofSource());
808809
}
809810

810811
private:

quiche/quic/core/http/quic_spdy_session.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ void QuicSpdySession::OnHttp3GoAway(uint64_t id) {
864864
stream->version().transport_version, stream->id())) {
865865
return true;
866866
}
867-
QuicSpdyStream* spdy_stream = static_cast<QuicSpdyStream*>(stream);
867+
QuicSpdyStream* spdy_stream = absl::static_cast<QuicSpdyStream*>(stream);
868868
WebTransportHttp3* web_transport = spdy_stream->web_transport();
869869
if (web_transport == nullptr) {
870870
return true;
@@ -981,7 +981,7 @@ QuicSpdyStream* QuicSpdySession::GetOrCreateSpdyDataStream(
981981
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
982982
return nullptr;
983983
}
984-
return static_cast<QuicSpdyStream*>(stream);
984+
return absl::static_cast<QuicSpdyStream*>(stream);
985985
}
986986

987987
void QuicSpdySession::OnNewEncryptionKeyAvailable(
@@ -1858,7 +1858,7 @@ void QuicSpdySession::OnDatagramReceived(absl::string_view datagram) {
18581858
stream_id64 *= kHttpDatagramStreamIdDivisor;
18591859
QuicStreamId stream_id = static_cast<QuicStreamId>(stream_id64);
18601860
QuicSpdyStream* stream =
1861-
static_cast<QuicSpdyStream*>(GetActiveStream(stream_id));
1861+
absl::static_cast<QuicSpdyStream*>(GetActiveStream(stream_id));
18621862
if (stream == nullptr) {
18631863
QUIC_DLOG(INFO) << "Received HTTP/3 datagram for unknown stream ID "
18641864
<< stream_id;

quiche/quic/core/http/web_transport_http3.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ WebTransportStream* WebTransportHttp3::AcceptIncomingUnidirectionalStream() {
222222
// receieved and the time the client has polled for them.
223223
continue;
224224
}
225-
return static_cast<WebTransportHttp3UnidirectionalStream*>(stream)
225+
return absl::static_cast<WebTransportHttp3UnidirectionalStream*>(stream)
226226
->interface();
227227
}
228228
return nullptr;
@@ -264,9 +264,9 @@ webtransport::Stream* WebTransportHttp3::GetStreamById(
264264
const bool bidi = QuicUtils::IsBidirectionalStreamId(
265265
id, ParsedQuicVersion::RFCv1()); // Assume IETF QUIC for WebTransport
266266
if (bidi) {
267-
return static_cast<QuicSpdyStream*>(stream)->web_transport_stream();
267+
return absl::static_cast<QuicSpdyStream*>(stream)->web_transport_stream();
268268
} else {
269-
return static_cast<WebTransportHttp3UnidirectionalStream*>(stream)
269+
return absl::static_cast<WebTransportHttp3UnidirectionalStream*>(stream)
270270
->interface();
271271
}
272272
}

0 commit comments

Comments
 (0)