Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Unified Diff: net/quic/core/quic_framer.cc

Issue 2747443002: Landing recent QUIC changes until Sun Mar 5 09:18:09 2017 +0000 (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/core/quic_framer.cc
diff --git a/net/quic/core/quic_framer.cc b/net/quic/core/quic_framer.cc
index 977fc2f925257a33c173b3332834b980a54a36b2..bacec506b4d1305b2157296e723494bd1c606b0e 100644
--- a/net/quic/core/quic_framer.cc
+++ b/net/quic/core/quic_framer.cc
@@ -207,11 +207,6 @@ size_t QuicFramer::GetBlockedFrameSize() {
}
// static
-size_t QuicFramer::GetPathCloseFrameSize() {
- return kQuicFrameTypeSize + kQuicPathIdSize;
-}
-
-// static
size_t QuicFramer::GetStreamIdSize(QuicStreamId stream_id) {
// Sizes are 1 through 4 bytes.
for (int i = 1; i <= 4; ++i) {
@@ -398,12 +393,6 @@ size_t QuicFramer::BuildDataPacket(const QuicPacketHeader& header,
return 0;
}
break;
- case PATH_CLOSE_FRAME:
- if (!AppendPathCloseFrame(*frame.path_close_frame, &writer)) {
- QUIC_BUG << "AppendPathCloseFrame failed";
- return 0;
- }
- break;
default:
RaiseError(QUIC_INVALID_FRAME_DATA);
QUIC_BUG << "QUIC_INVALID_FRAME_DATA";
@@ -784,7 +773,9 @@ bool QuicFramer::ProcessPublicHeader(QuicDataReader* reader,
(public_flags & PACKET_PUBLIC_FLAGS_VERSION) != 0;
if (validate_flags_ && !public_header->version_flag &&
- public_flags > PACKET_PUBLIC_FLAGS_MAX) {
+ public_flags > (FLAGS_quic_reloadable_flag_quic_remove_multipath_bit
+ ? PACKET_PUBLIC_FLAGS_MAX_WITHOUT_MULTIPATH_FLAG
+ : PACKET_PUBLIC_FLAGS_MAX)) {
set_detailed_error("Illegal public flags value.");
return false;
}
@@ -825,7 +816,10 @@ bool QuicFramer::ProcessPublicHeader(QuicDataReader* reader,
// If not, this raises an error.
last_version_tag_ = version_tag;
QuicVersion version = QuicTagToQuicVersion(version_tag);
- if (version == quic_version_ && public_flags > PACKET_PUBLIC_FLAGS_MAX) {
+ if (version == quic_version_ &&
+ public_flags > (FLAGS_quic_reloadable_flag_quic_remove_multipath_bit
+ ? PACKET_PUBLIC_FLAGS_MAX_WITHOUT_MULTIPATH_FLAG
+ : PACKET_PUBLIC_FLAGS_MAX)) {
set_detailed_error("Illegal public flags value.");
return false;
}
@@ -1113,19 +1107,6 @@ bool QuicFramer::ProcessFrameData(QuicDataReader* reader,
}
continue;
}
- case PATH_CLOSE_FRAME: {
- QuicPathCloseFrame path_close_frame;
- if (!ProcessPathCloseFrame(reader, &path_close_frame)) {
- return RaiseError(QUIC_INVALID_PATH_CLOSE_DATA);
- }
- if (!visitor_->OnPathCloseFrame(path_close_frame)) {
- QUIC_DVLOG(1) << ENDPOINT
- << "Visitor asked to stop further processing.";
- // Returning true since there was no parsing error.
- return true;
- }
- continue;
- }
default:
set_detailed_error("Illegal frame type.");
@@ -1449,16 +1430,6 @@ bool QuicFramer::ProcessBlockedFrame(QuicDataReader* reader,
return true;
}
-bool QuicFramer::ProcessPathCloseFrame(QuicDataReader* reader,
- QuicPathCloseFrame* frame) {
- if (!reader->ReadBytes(&frame->path_id, 1)) {
- set_detailed_error("Unable to read path_id.");
- return false;
- }
-
- return true;
-}
-
// static
QuicStringPiece QuicFramer::GetAssociatedDataFromEncryptedPacket(
QuicVersion version,
@@ -1699,8 +1670,6 @@ size_t QuicFramer::ComputeFrameLength(
return GetWindowUpdateFrameSize();
case BLOCKED_FRAME:
return GetBlockedFrameSize();
- case PATH_CLOSE_FRAME:
- return GetPathCloseFrameSize();
case PADDING_FRAME:
DCHECK(false);
return 0;
@@ -2134,15 +2103,6 @@ bool QuicFramer::AppendBlockedFrame(const QuicBlockedFrame& frame,
return true;
}
-bool QuicFramer::AppendPathCloseFrame(const QuicPathCloseFrame& frame,
- QuicDataWriter* writer) {
- uint8_t path_id = static_cast<uint8_t>(frame.path_id);
- if (!writer->WriteUInt8(path_id)) {
- return false;
- }
- return true;
-}
-
bool QuicFramer::RaiseError(QuicErrorCode error) {
QUIC_DLOG(INFO) << ENDPOINT << "Error: " << QuicErrorCodeToString(error)
<< " detail: " << detailed_error_;

Powered by Google App Engine
This is Rietveld 408576698