• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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_HTTP_HTTP_LOG_UTIL_H_
6 #define NET_HTTP_HTTP_LOG_UTIL_H_
7 
8 #include <string>
9 #include <string_view>
10 
11 #include "net/base/net_export.h"
12 #include "net/log/net_log_capture_mode.h"
13 #include "net/log/net_log_event_type.h"
14 
15 namespace net {
16 
17 class NetLogWithSource;
18 class HttpResponseHeaders;
19 class HttpRequestHeaders;
20 
21 // Given an HTTP header |header| with value |value|, returns the elided version
22 // of the header value at |log_level|.
23 NET_EXPORT_PRIVATE std::string ElideHeaderValueForNetLog(
24     NetLogCaptureMode capture_mode,
25     std::string_view header,
26     std::string_view value);
27 
28 NET_EXPORT void NetLogResponseHeaders(const NetLogWithSource& net_log,
29                                       NetLogEventType type,
30                                       const HttpResponseHeaders* headers);
31 
32 NET_EXPORT void NetLogRequestHeaders(const NetLogWithSource& net_log,
33                                      NetLogEventType type,
34                                      const std::string& request_line,
35                                      const HttpRequestHeaders* headers);
36 
37 }  // namespace net
38 
39 #endif  // NET_HTTP_HTTP_LOG_UTIL_H_
40