xref: /aosp_15_r20/external/cronet/net/spdy/spdy_log_util.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_SPDY_SPDY_LOG_UTIL_H_
6 #define NET_SPDY_SPDY_LOG_UTIL_H_
7 
8 #include <string_view>
9 
10 #include "base/values.h"
11 #include "net/base/net_export.h"
12 #include "net/http/http_log_util.h"
13 #include "net/log/net_log.h"
14 #include "net/log/net_log_capture_mode.h"
15 #include "net/third_party/quiche/src/quiche/spdy/core/http2_header_block.h"
16 
17 namespace net {
18 
19 // Given an HTTP/2 GOAWAY frame |debug_data|, returns the elided version
20 // according to |capture_mode|.
21 NET_EXPORT_PRIVATE base::Value ElideGoAwayDebugDataForNetLog(
22     NetLogCaptureMode capture_mode,
23     std::string_view debug_data);
24 
25 // Given a spdy::Http2HeaderBlock, return its base::Value::List representation.
26 NET_EXPORT_PRIVATE base::Value::List ElideHttp2HeaderBlockForNetLog(
27     const spdy::Http2HeaderBlock& headers,
28     NetLogCaptureMode capture_mode);
29 
30 // Converts a spdy::Http2HeaderBlock into NetLog event parameters.
31 NET_EXPORT_PRIVATE base::Value::Dict Http2HeaderBlockNetLogParams(
32     const spdy::Http2HeaderBlock* headers,
33     NetLogCaptureMode capture_mode);
34 
35 }  // namespace net
36 
37 #endif  // NET_SPDY_SPDY_LOG_UTIL_H_
38