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

Unified Diff: net/http/http_log_util.cc

Issue 1360253002: Log GOAWAY frame debug data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #12. Created 5 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
« no previous file with comments | « net/http/http_log_util.h ('k') | net/http/http_log_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_log_util.cc
diff --git a/net/http/http_log_util.cc b/net/http/http_log_util.cc
index 87c2fd99f191cf2c11443611bd6db6d90000686b..500f2209da24b4e5457ff82005ba6dec396622e1 100644
--- a/net/http/http_log_util.cc
+++ b/net/http/http_log_util.cc
@@ -4,6 +4,7 @@
#include "net/http/http_log_util.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/http/http_auth_challenge_tokenizer.h"
@@ -42,7 +43,7 @@ std::string ElideHeaderValueForNetLog(NetLogCaptureMode capture_mode,
if (redact_begin == redact_end &&
!capture_mode.include_cookies_and_credentials()) {
- // Note: this logic should be kept in sync with stripCookiesAndLoginInfo in
+ // Note: this logic should be kept in sync with stripCookieOrLoginInfo in
// chrome/browser/resources/net_internals/log_view_painter.js.
if (base::EqualsCaseInsensitiveASCII(header, "set-cookie") ||
@@ -73,4 +74,16 @@ std::string ElideHeaderValueForNetLog(NetLogCaptureMode capture_mode,
std::string(redact_end, value.end());
}
+std::string ElideGoAwayDebugDataForNetLog(NetLogCaptureMode capture_mode,
+ base::StringPiece debug_data) {
+ // Note: this logic should be kept in sync with stripGoAwayDebugData in
+ // chrome/browser/resources/net_internals/log_view_painter.js.
+ if (capture_mode.include_cookies_and_credentials()) {
+ return debug_data.as_string();
+ }
+
+ return std::string("[") + base::SizeTToString(debug_data.size()) +
+ std::string(" bytes were stripped]");
+}
+
} // namespace net
« no previous file with comments | « net/http/http_log_util.h ('k') | net/http/http_log_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698