Commit d05d86ef authored by Eric Lawrence's avatar Eric Lawrence Committed by Commit Bot

Simplify NetLog usage in SpdyStream

Logging calls to NetLog in the SpdyStream object were inconsistent
and overly verbose. This patch makes them simpler and consistent.
There should be no functional change.

Change-Id: I689dcdbcea4673223c5a34c173065b72125e6686
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210553
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770861}
parent 95dd79d4
This diff is collapsed.
...@@ -35,11 +35,11 @@ namespace { ...@@ -35,11 +35,11 @@ namespace {
base::Value NetLogSpdyStreamErrorParams(spdy::SpdyStreamId stream_id, base::Value NetLogSpdyStreamErrorParams(spdy::SpdyStreamId stream_id,
int net_error, int net_error,
const std::string* description) { base::StringPiece description) {
base::Value dict(base::Value::Type::DICTIONARY); base::Value dict(base::Value::Type::DICTIONARY);
dict.SetIntKey("stream_id", static_cast<int>(stream_id)); dict.SetIntKey("stream_id", static_cast<int>(stream_id));
dict.SetStringKey("net_error", ErrorToShortString(net_error)); dict.SetStringKey("net_error", ErrorToShortString(net_error));
dict.SetStringKey("description", *description); dict.SetStringKey("description", description);
return dict; return dict;
} }
...@@ -660,9 +660,9 @@ int SpdyStream::OnDataSent(size_t frame_size) { ...@@ -660,9 +660,9 @@ int SpdyStream::OnDataSent(size_t frame_size) {
} }
} }
void SpdyStream::LogStreamError(int error, const std::string& description) { void SpdyStream::LogStreamError(int error, base::StringPiece description) {
net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ERROR, [&] { net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ERROR, [&] {
return NetLogSpdyStreamErrorParams(stream_id_, error, &description); return NetLogSpdyStreamErrorParams(stream_id_, error, description);
}); });
} }
......
...@@ -301,7 +301,7 @@ class NET_EXPORT_PRIVATE SpdyStream { ...@@ -301,7 +301,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 error, const std::string& description); void LogStreamError(int error, base::StringPiece 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