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

Unified Diff: net/spdy/spdy_framer.cc

Issue 2675593002: Spdy{RstStream,GoAway}Status -> SpdyErrorCode. (Closed)
Patch Set: Unsigned vs signed int Created 3 years, 11 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 f9c1e66f1a6da0736f14d7fc878066d1e1832b52..476942f89ecfd9678c030608eb55832a0287970b 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -405,33 +405,33 @@ const char* SpdyFramer::SpdyFramerErrorToString(int spdy_framer_error) {
const char* SpdyFramer::StatusCodeToString(int status_code) {
Bence 2017/02/02 15:12:25 This method is removed in server change 145087791,
diannahu 2017/02/02 15:58:09 Got it, will do! (I was wondering why I didn't see
switch (status_code) {
- case RST_STREAM_NO_ERROR:
+ case ERROR_CODE_NO_ERROR:
return "NO_ERROR";
- case RST_STREAM_PROTOCOL_ERROR:
+ case ERROR_CODE_PROTOCOL_ERROR:
return "PROTOCOL_ERROR";
- case RST_STREAM_INTERNAL_ERROR:
+ case ERROR_CODE_INTERNAL_ERROR:
return "INTERNAL_ERROR";
- case RST_STREAM_FLOW_CONTROL_ERROR:
+ case ERROR_CODE_FLOW_CONTROL_ERROR:
return "FLOW_CONTROL_ERROR";
- case RST_STREAM_SETTINGS_TIMEOUT:
+ case ERROR_CODE_SETTINGS_TIMEOUT:
return "SETTINGS_TIMEOUT";
- case RST_STREAM_STREAM_CLOSED:
+ case ERROR_CODE_STREAM_CLOSED:
return "STREAM_CLOSED";
- case RST_STREAM_FRAME_SIZE_ERROR:
+ case ERROR_CODE_FRAME_SIZE_ERROR:
return "FRAME_SIZE_ERROR";
- case RST_STREAM_REFUSED_STREAM:
+ case ERROR_CODE_REFUSED_STREAM:
return "REFUSED_STREAM";
- case RST_STREAM_CANCEL:
+ case ERROR_CODE_CANCEL:
return "CANCEL";
- case RST_STREAM_COMPRESSION_ERROR:
+ case ERROR_CODE_COMPRESSION_ERROR:
return "COMPRESSION_ERROR";
- case RST_STREAM_CONNECT_ERROR:
+ case ERROR_CODE_CONNECT_ERROR:
return "CONNECT_ERROR";
- case RST_STREAM_ENHANCE_YOUR_CALM:
+ case ERROR_CODE_ENHANCE_YOUR_CALM:
return "ENHANCE_YOUR_CALM";
- case RST_STREAM_INADEQUATE_SECURITY:
+ case ERROR_CODE_INADEQUATE_SECURITY:
return "INADEQUATE_SECURITY";
- case RST_STREAM_HTTP_1_1_REQUIRED:
+ case ERROR_CODE_HTTP_1_1_REQUIRED:
return "HTTP_1_1_REQUIRED";
}
return "UNKNOWN_STATUS";
@@ -1356,12 +1356,12 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {
// Use frame-specific handlers.
switch (current_frame_type_) {
case RST_STREAM: {
- uint32_t status_raw = RST_STREAM_NO_ERROR;
- bool successful_read = reader.ReadUInt32(&status_raw);
+ uint32_t error_code = ERROR_CODE_NO_ERROR;
+ bool successful_read = reader.ReadUInt32(&error_code);
DCHECK(successful_read);
DCHECK(reader.IsDoneReading());
- SpdyRstStreamStatus status = ParseRstStreamStatus(status_raw);
- visitor_->OnRstStream(current_frame_stream_id_, status);
+ visitor_->OnRstStream(current_frame_stream_id_,
+ ParseErrorCode(error_code));
} break;
case PING: {
SpdyPingId id = 0;
@@ -1441,12 +1441,11 @@ size_t SpdyFramer::ProcessGoAwayFramePayload(const char* data, size_t len) {
DCHECK(successful_read);
// Parse status code.
- uint32_t status_raw = GOAWAY_NO_ERROR;
- successful_read = reader.ReadUInt32(&status_raw);
+ uint32_t error_code = ERROR_CODE_NO_ERROR;
+ successful_read = reader.ReadUInt32(&error_code);
DCHECK(successful_read);
- SpdyGoAwayStatus status = ParseGoAwayStatus(status_raw);
// Finished parsing the GOAWAY header, call frame handler.
- visitor_->OnGoAway(current_frame_stream_id_, status);
+ visitor_->OnGoAway(current_frame_stream_id_, ParseErrorCode(error_code));
}
}
@@ -1798,7 +1797,7 @@ SpdySerializedFrame SpdyFramer::SerializeRstStream(
builder.BeginNewFrame(*this, RST_STREAM, 0, rst_stream.stream_id());
- builder.WriteUInt32(rst_stream.status());
+ builder.WriteUInt32(rst_stream.error_code());
DCHECK_EQ(expected_length, builder.length());
return builder.take();
@@ -1862,8 +1861,8 @@ SpdySerializedFrame SpdyFramer::SerializeGoAway(
// GOAWAY frames specify the last good stream id.
builder.WriteUInt32(goaway.last_good_stream_id());
- // GOAWAY frames also specify the error status code.
- builder.WriteUInt32(goaway.status());
+ // GOAWAY frames also specify the error code.
+ builder.WriteUInt32(goaway.error_code());
// GOAWAY frames may also specify opaque data.
if (!goaway.description().empty()) {

Powered by Google App Engine
This is Rietveld 408576698