Commit 2306cac8 authored by Ryan Hamilton's avatar Ryan Hamilton Committed by Commit Bot

Add a QUIC_FALLTHROUGH_INTENDED annotation to QUIC's platform API.

Merge internal change: 183282622

Change-Id: Ibef39b6e706ebd86972909504ce521b460f813ec
Reviewed-on: https://chromium-review.googlesource.com/886823
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532148}
parent 5adc578c
......@@ -1432,6 +1432,7 @@ component("net") {
"quic/platform/api/quic_endian.h",
"quic/platform/api/quic_estimate_memory_usage.h",
"quic/platform/api/quic_export.h",
"quic/platform/api/quic_fallthrough.h",
"quic/platform/api/quic_flag_utils.h",
"quic/platform/api/quic_flags.h",
"quic/platform/api/quic_hostname_utils.cc",
......@@ -1472,6 +1473,7 @@ component("net") {
"quic/platform/impl/quic_endian_impl.h",
"quic/platform/impl/quic_estimate_memory_usage_impl.h",
"quic/platform/impl/quic_export_impl.h",
"quic/platform/impl/quic_fallthrough_impl.h",
"quic/platform/impl/quic_flag_utils_impl.h",
"quic/platform/impl/quic_flags_impl.cc",
"quic/platform/impl/quic_flags_impl.h",
......
......@@ -10,6 +10,7 @@
#include "net/quic/core/congestion_control/rtt_stats.h"
#include "net/quic/core/crypto/crypto_protocol.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_flag_utils.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_logging.h"
......@@ -613,7 +614,7 @@ void BbrSender::UpdateRecoveryState(QuicPacketNumber last_acked_packet,
if (is_round_start) {
recovery_state_ = GROWTH;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case GROWTH:
// Exit recovery if appropriate.
......
......@@ -8,6 +8,7 @@
#include "net/quic/core/congestion_control/tcp_cubic_sender_bytes.h"
#include "net/quic/core/quic_packets.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_flag_utils.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_pcc_sender.h"
......@@ -38,7 +39,7 @@ SendAlgorithmInterface* SendAlgorithmInterface::Create(
max_congestion_window);
}
// Fall back to CUBIC if PCC is disabled.
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case kCubicBytes:
return new TcpCubicSenderBytes(
clock, rtt_stats, false /* don't use Reno */,
......
......@@ -8,6 +8,7 @@
#include "net/quic/core/quic_data_reader.h"
#include "net/quic/core/quic_data_writer.h"
#include "net/quic/core/quic_packets.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_str_cat.h"
#include "net/quic/platform/api/quic_string_piece.h"
......@@ -245,7 +246,7 @@ QuicErrorCode CryptoFramer::Process(QuicStringPiece input,
reader.ReadTag(&message_tag);
message_.set_tag(message_tag);
state_ = STATE_READING_NUM_ENTRIES;
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case STATE_READING_NUM_ENTRIES:
if (reader.BytesRemaining() < kNumEntriesSize + sizeof(uint16_t)) {
break;
......@@ -261,7 +262,7 @@ QuicErrorCode CryptoFramer::Process(QuicStringPiece input,
tags_and_lengths_.reserve(num_entries_);
state_ = STATE_READING_TAGS_AND_LENGTHS;
values_len_ = 0;
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case STATE_READING_TAGS_AND_LENGTHS: {
if (reader.BytesRemaining() <
num_entries_ * (kQuicTagSize + kCryptoEndOffsetSize)) {
......@@ -295,7 +296,7 @@ QuicErrorCode CryptoFramer::Process(QuicStringPiece input,
}
values_len_ = last_end_offset;
state_ = STATE_READING_VALUES;
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
}
case STATE_READING_VALUES:
if (reader.BytesRemaining() < values_len_) {
......
......@@ -35,6 +35,7 @@
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_clock.h"
#include "net/quic/platform/api/quic_endian.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_flag_utils.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_hostname_utils.h"
......@@ -815,7 +816,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterGetProof(
&params->token_binding_key_param, nullptr)) {
break;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
default:
helper.Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
"Invalid Token Binding key parameter");
......
......@@ -22,6 +22,7 @@
#include "net/quic/core/quic_utils.h"
#include "net/quic/platform/api/quic_aligned.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_flag_utils.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_logging.h"
......@@ -417,7 +418,8 @@ size_t QuicFramer::BuildDataPacket(const QuicPacketHeader& header,
}
break;
case MTU_DISCOVERY_FRAME:
// MTU discovery frames are serialized as ping frames.
// MTU discovery frames are serialized as ping frames.
QUIC_FALLTHROUGH_INTENDED;
case PING_FRAME:
// Ping has no payload.
break;
......@@ -1884,7 +1886,8 @@ size_t QuicFramer::ComputeFrameLength(
return GetStopWaitingFrameSize(version_.transport_version,
packet_number_length);
case MTU_DISCOVERY_FRAME:
// MTU discovery frames are serialized as ping frames.
// MTU discovery frames are serialized as ping frames.
QUIC_FALLTHROUGH_INTENDED;
case PING_FRAME:
// Ping has no payload.
return kQuicFrameTypeSize;
......
......@@ -11,6 +11,7 @@
#include "net/quic/core/quic_headers_stream.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
#include "net/quic/platform/api/quic_flag_utils.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_logging.h"
......@@ -153,7 +154,7 @@ class QuicSpdySession::SpdyFramerVisitor
if (GetQuicReloadableFlag(quic_send_max_header_list_size)) {
break;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
default:
CloseConnection(
QuicStrCat("Unsupported field of HTTP/2 SETTINGS frame: ", id),
......
......@@ -13,6 +13,7 @@
#include "net/quic/http/quic_http_constants.h"
#include "net/quic/http/quic_http_structures.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
namespace net {
......@@ -74,7 +75,7 @@ QuicHttpAltSvcQuicHttpPayloadDecoder::ResumeDecodingPayload(
switch (payload_state_) {
case PayloadState::kStartDecodingStruct:
status = state->StartDecodingStructureInPayload(&altsvc_fields_, db);
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kMaybeDecodedStruct:
if (status == QuicHttpDecodeStatus::kDecodeDone &&
......@@ -96,7 +97,7 @@ QuicHttpAltSvcQuicHttpPayloadDecoder::ResumeDecodingPayload(
DCHECK_GT(altsvc_fields_.origin_length, state->remaining_payload());
return state->ReportFrameSizeError();
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kDecodingStrings:
return DecodeStrings(state, db);
......
......@@ -15,6 +15,7 @@
#include "net/quic/http/quic_http_constants.h"
#include "net/quic/http/quic_http_structures.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
namespace net {
......@@ -103,7 +104,7 @@ QuicHttpDecodeStatus QuicHttpDataQuicHttpPayloadDecoder::ResumeDecodingPayload(
if (status != QuicHttpDecodeStatus::kDecodeDone) {
return status;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kReadPayload:
avail = state->AvailablePayload(db);
......@@ -116,7 +117,7 @@ QuicHttpDecodeStatus QuicHttpDataQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kReadPayload;
return QuicHttpDecodeStatus::kDecodeInProgress;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kSkipPadding:
// SkipPadding handles the OnPadding callback.
......
......@@ -13,6 +13,7 @@
#include "net/quic/http/quic_http_constants.h"
#include "net/quic/http/quic_http_structures.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
namespace net {
......@@ -77,7 +78,7 @@ QuicHttpGoAwayQuicHttpPayloadDecoder::ResumeDecodingPayload(
switch (payload_state_) {
case PayloadState::kStartDecodingFixedFields:
status = state->StartDecodingStructureInPayload(&goaway_fields_, db);
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kHandleFixedFieldsStatus:
if (status == QuicHttpDecodeStatus::kDecodeDone) {
......@@ -95,7 +96,7 @@ QuicHttpGoAwayQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kResumeDecodingFixedFields;
return status;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kReadOpaqueData:
// The opaque data is all the remains to be decoded, so anything left
......
......@@ -15,6 +15,7 @@
#include "net/quic/http/quic_http_constants.h"
#include "net/quic/http/quic_http_structures.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
namespace net {
......@@ -138,7 +139,7 @@ QuicHttpHeadersQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kReadPayload;
continue;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kStartDecodingPriorityFields:
status = state->StartDecodingStructureInPayload(&priority_fields_, db);
......@@ -147,7 +148,7 @@ QuicHttpHeadersQuicHttpPayloadDecoder::ResumeDecodingPayload(
return status;
}
state->listener()->OnHeadersPriority(priority_fields_);
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kReadPayload:
avail = state->AvailablePayload(db);
......@@ -160,7 +161,7 @@ QuicHttpHeadersQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kReadPayload;
return QuicHttpDecodeStatus::kDecodeInProgress;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kSkipPadding:
// SkipPadding handles the OnPadding callback.
......
......@@ -15,6 +15,7 @@
#include "net/quic/http/quic_http_constants.h"
#include "net/quic/http/quic_http_structures.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_fallthrough.h"
namespace net {
......@@ -101,7 +102,7 @@ QuicHttpPushPromiseQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kReadPadLength;
return status;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kStartDecodingPushPromiseFields:
status =
......@@ -113,7 +114,7 @@ QuicHttpPushPromiseQuicHttpPayloadDecoder::ResumeDecodingPayload(
// Finished decoding the Promised Stream ID. Can now tell the listener
// that we're starting to decode a PUSH_PROMISE frame.
ReportPushPromise(state);
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kReadPayload:
DCHECK_LT(state->remaining_payload(), frame_header.payload_length);
......@@ -136,7 +137,7 @@ QuicHttpPushPromiseQuicHttpPayloadDecoder::ResumeDecodingPayload(
payload_state_ = PayloadState::kReadPayload;
return QuicHttpDecodeStatus::kDecodeInProgress;
}
FALLTHROUGH;
QUIC_FALLTHROUGH_INTENDED;
case PayloadState::kSkipPadding:
// SkipPadding handles the OnPadding callback.
......
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
#define NET_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
#include "net/quic/platform/impl/quic_fallthrough_impl.h"
#define QUIC_FALLTHROUGH_INTENDED QUIC_FALLTHROUGH_INTENDED_IMPL
#endif // NET_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_PLATFORM_IMPL_QUIC_FALLTHROUGH_IMPL_H_
#define NET_QUIC_PLATFORM_IMPL_QUIC_FALLTHROUGH_IMPL_H_
#define QUIC_FALLTHROUGH_INTENDED_IMPL FALLTHROUGH
#endif // NET_QUIC_PLATFORM_IMPL_QUIC_FALLTHROUGH_IMPL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment