xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/http2/adapter/http2_util.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 #ifndef QUICHE_HTTP2_ADAPTER_HTTP2_UTIL_H_
2 #define QUICHE_HTTP2_ADAPTER_HTTP2_UTIL_H_
3 
4 #include <cstdint>
5 
6 #include "quiche/http2/adapter/http2_protocol.h"
7 #include "quiche/http2/adapter/http2_visitor_interface.h"
8 #include "quiche/common/platform/api/quiche_export.h"
9 #include "quiche/spdy/core/spdy_protocol.h"
10 
11 namespace http2 {
12 namespace adapter {
13 
14 QUICHE_EXPORT spdy::SpdyErrorCode TranslateErrorCode(Http2ErrorCode code);
15 QUICHE_EXPORT Http2ErrorCode TranslateErrorCode(spdy::SpdyErrorCode code);
16 
17 QUICHE_EXPORT absl::string_view ConnectionErrorToString(
18     Http2VisitorInterface::ConnectionError error);
19 
20 QUICHE_EXPORT absl::string_view InvalidFrameErrorToString(
21     Http2VisitorInterface::InvalidFrameError error);
22 
23 // A WINDOW_UPDATE sending strategy that returns true if the `delta` to be sent
24 // is positive and at least half of the window `limit`.
25 QUICHE_EXPORT bool DeltaAtLeastHalfLimit(int64_t limit, int64_t /*size*/,
26                                          int64_t delta);
27 
28 }  // namespace adapter
29 }  // namespace http2
30 
31 #endif  // QUICHE_HTTP2_ADAPTER_HTTP2_UTIL_H_
32