OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_HTTP_HTTP_LOG_UTIL_H_ | 5 #ifndef NET_SPDY_SPDY_LOG_UTIL_H_ |
6 #define NET_HTTP_HTTP_LOG_UTIL_H_ | 6 #define NET_SPDY_SPDY_LOG_UTIL_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 #include "net/log/net_log_capture_mode.h" |
12 #include "net/spdy/spdy_header_block.h" | 14 #include "net/spdy/spdy_header_block.h" |
13 | 15 |
14 namespace base { | 16 namespace base { |
15 class ListValue; | 17 class ListValue; |
16 } // namespace base | 18 } // namespace base |
17 | 19 |
18 namespace net { | 20 namespace net { |
19 | 21 |
20 class NetLogCaptureMode; | |
21 | |
22 // Given an HTTP header |header| with value |value|, returns the elided version | |
23 // of the header value at |log_level|. | |
24 NET_EXPORT_PRIVATE std::string ElideHeaderValueForNetLog( | |
25 NetLogCaptureMode capture_mode, | |
26 const std::string& header, | |
27 const std::string& value); | |
28 | |
29 // Given an HTTP/2 GOAWAY frame |debug_data|, returns the elided version | 22 // Given an HTTP/2 GOAWAY frame |debug_data|, returns the elided version |
30 // according to |capture_mode|. | 23 // according to |capture_mode|. |
31 NET_EXPORT_PRIVATE std::string ElideGoAwayDebugDataForNetLog( | 24 NET_EXPORT_PRIVATE std::string ElideGoAwayDebugDataForNetLog( |
32 NetLogCaptureMode capture_mode, | 25 NetLogCaptureMode capture_mode, |
33 base::StringPiece debug_data); | 26 base::StringPiece debug_data); |
34 | 27 |
35 // Given a SpdyHeaderBlock, return its base::ListValue representation. | 28 // Given a SpdyHeaderBlock, return its base::ListValue representation. |
36 std::unique_ptr<base::ListValue> ElideSpdyHeaderBlockForNetLog( | 29 NET_EXPORT_PRIVATE std::unique_ptr<base::ListValue> |
37 const SpdyHeaderBlock& headers, | 30 ElideSpdyHeaderBlockForNetLog(const SpdyHeaderBlock& headers, |
38 NetLogCaptureMode capture_mode); | 31 NetLogCaptureMode capture_mode); |
39 | 32 |
40 } // namespace net | 33 } // namespace net |
41 | 34 |
42 #endif // NET_HTTP_HTTP_LOG_UTIL_H_ | 35 #endif // NET_SPDY_SPDY_LOG_UTIL_H_ |
OLD | NEW |