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

Unified Diff: net/spdy/spdy_framer.cc

Issue 637023002: Misc. cleanup, primarily removing unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove macros.h change Created 6 years, 2 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/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index edcc82e5fa021a3e68a7cd7ee206b8f2c92a2d97..f470c213c6de5a4966277f3b1aee7a3ec81e9b39 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -675,15 +675,15 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
new SpdyFrameReader(current_frame_buffer_.get(),
current_frame_buffer_length_));
- uint16 version = 0;
bool is_control_frame = false;
uint16 control_frame_type_field =
- SpdyConstants::DataFrameType(protocol_version());
+ SpdyConstants::DataFrameType(protocol_version());
// ProcessControlFrameHeader() will set current_frame_type_ to the
// correct value if this is a valid control frame.
current_frame_type_ = DATA;
if (protocol_version() <= SPDY3) {
+ uint16 version = 0;
bool successful_read = reader->ReadUInt16(&version);
DCHECK(successful_read);
is_control_frame = (version & kControlFlagMask) != 0;
@@ -700,9 +700,6 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
<< " (expected " << protocol_version() << ")";
set_error(SPDY_UNSUPPORTED_VERSION);
return 0;
- } else {
- // Convert version from wire format to SpdyMajorVersion.
- version = SpdyConstants::ParseMajorVersion(version);
}
// We check control_frame_type_field's validity in
// ProcessControlFrameHeader().
@@ -722,7 +719,6 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
remaining_data_length_ = length_field;
current_frame_length_ = remaining_data_length_ + reader->GetBytesConsumed();
} else {
- version = protocol_version();
uint32 length_field = 0;
bool successful_read = reader->ReadUInt24(&length_field);
DCHECK(successful_read);
@@ -1173,9 +1169,9 @@ void SpdyFramer::WriteHeaderBlock(SpdyFrameBuilder* frame,
const SpdyMajorVersion spdy_version,
const SpdyHeaderBlock* headers) {
if (spdy_version < SPDY3) {
- frame->WriteUInt16(headers->size()); // Number of headers.
+ frame->WriteUInt16(headers->size());
} else {
- frame->WriteUInt32(headers->size()); // Number of headers.
+ frame->WriteUInt32(headers->size());
}
SpdyHeaderBlock::const_iterator it;
for (it = headers->begin(); it != headers->end(); ++it) {

Powered by Google App Engine
This is Rietveld 408576698