Commit 3d850db7 authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Stringify network error in HTTP2_STREAM_ERROR.

Change NetLogSpdyStreamErrorCallback() to stringify error.
Example netlog output before this change:

HTTP2_STREAM_ERROR
--> description = "SPDY stream closed with error_code: 2"
--> status = -337
--> stream_id = 59

After this change:

HTTP2_STREAM_ERROR
--> description = "SPDY stream closed with error_code: 2"
--> error = SPDY_PROTOCOL_ERROR
--> stream_id = 59

Change-Id: If58ad76f3b99dde7f22e8bf81c2251f6fba9d2e3
Reviewed-on: https://chromium-review.googlesource.com/594192
Commit-Queue: Bence Béky <bnc@chromium.org>
Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491176}
parent 9792d744
...@@ -35,12 +35,12 @@ namespace { ...@@ -35,12 +35,12 @@ namespace {
std::unique_ptr<base::Value> NetLogSpdyStreamErrorCallback( std::unique_ptr<base::Value> NetLogSpdyStreamErrorCallback(
SpdyStreamId stream_id, SpdyStreamId stream_id,
int status, int net_error,
const SpdyString* description, const SpdyString* description,
NetLogCaptureMode /* capture_mode */) { NetLogCaptureMode /* capture_mode */) {
auto dict = base::MakeUnique<base::DictionaryValue>(); auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetInteger("stream_id", static_cast<int>(stream_id)); dict->SetInteger("stream_id", static_cast<int>(stream_id));
dict->SetInteger("status", status); dict->SetString("net_error", ErrorToShortString(net_error));
dict->SetString("description", *description); dict->SetString("description", *description);
return std::move(dict); return std::move(dict);
} }
...@@ -636,10 +636,10 @@ int SpdyStream::OnDataSent(size_t frame_size) { ...@@ -636,10 +636,10 @@ int SpdyStream::OnDataSent(size_t frame_size) {
} }
} }
void SpdyStream::LogStreamError(int status, const SpdyString& description) { void SpdyStream::LogStreamError(int error, const SpdyString& description) {
net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ERROR, net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ERROR,
base::Bind(&NetLogSpdyStreamErrorCallback, stream_id_, base::Bind(&NetLogSpdyStreamErrorCallback, stream_id_,
status, &description)); error, &description));
} }
void SpdyStream::OnClose(int status) { void SpdyStream::OnClose(int status) {
......
...@@ -289,7 +289,7 @@ class NET_EXPORT_PRIVATE SpdyStream { ...@@ -289,7 +289,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
void OnClose(int status); void OnClose(int status);
// Called by the SpdySession to log stream related errors. // Called by the SpdySession to log stream related errors.
void LogStreamError(int status, const SpdyString& description); void LogStreamError(int error, const SpdyString& description);
// If this stream is active, reset it, and close it otherwise. In // If this stream is active, reset it, and close it otherwise. In
// either case the stream is deleted. // either case the stream is deleted.
......
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