xref: /aosp_15_r20/external/cronet/net/quic/quic_http_utils.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2013 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_QUIC_QUIC_HTTP_UTILS_H_
6 #define NET_QUIC_QUIC_HTTP_UTILS_H_
7 
8 #include "base/values.h"
9 #include "net/base/net_export.h"
10 #include "net/base/request_priority.h"
11 #include "net/log/net_log_capture_mode.h"
12 #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h"
13 #include "net/third_party/quiche/src/quiche/quic/core/quic_stream_priority.h"
14 #include "net/third_party/quiche/src/quiche/spdy/core/http2_header_block.h"
15 #include "net/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h"
16 
17 namespace net {
18 
19 // TODO(crbug/988608): Convert to SpdyStreamPrecedence directly instead of to
20 // SpdyPriority which will go away eventually.
21 NET_EXPORT_PRIVATE spdy::SpdyPriority ConvertRequestPriorityToQuicPriority(
22     RequestPriority priority);
23 
24 NET_EXPORT_PRIVATE RequestPriority
25 ConvertQuicPriorityToRequestPriority(spdy::SpdyPriority priority);
26 
27 // Converts a spdy::Http2HeaderBlock, stream_id and priority into NetLog event
28 // parameters.
29 NET_EXPORT base::Value::Dict QuicRequestNetLogParams(
30     quic::QuicStreamId stream_id,
31     const spdy::Http2HeaderBlock* headers,
32     quic::QuicStreamPriority priority,
33     NetLogCaptureMode capture_mode);
34 
35 // Converts a spdy::Http2HeaderBlock and stream into NetLog event parameters.
36 NET_EXPORT base::Value::Dict QuicResponseNetLogParams(
37     quic::QuicStreamId stream_id,
38     bool fin_received,
39     const spdy::Http2HeaderBlock* headers,
40     NetLogCaptureMode capture_mode);
41 
42 }  // namespace net
43 
44 #endif  // NET_QUIC_QUIC_HTTP_UTILS_H_
45