quic_http_utils.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_QUIC_QUIC_HTTP_UTILS_H_
  5. #define NET_QUIC_QUIC_HTTP_UTILS_H_
  6. #include "base/values.h"
  7. #include "net/base/net_export.h"
  8. #include "net/base/request_priority.h"
  9. #include "net/log/net_log_capture_mode.h"
  10. #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h"
  11. #include "net/third_party/quiche/src/quiche/spdy/core/http2_header_block.h"
  12. #include "net/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h"
  13. namespace net {
  14. // TODO(crbug/988608): Convert to SpdyStreamPrecedence directly instead of to
  15. // SpdyPriority which will go away eventually.
  16. NET_EXPORT_PRIVATE spdy::SpdyPriority ConvertRequestPriorityToQuicPriority(
  17. RequestPriority priority);
  18. NET_EXPORT_PRIVATE RequestPriority
  19. ConvertQuicPriorityToRequestPriority(spdy::SpdyPriority priority);
  20. // Converts a spdy::Http2HeaderBlock, stream_id and priority into NetLog event
  21. // parameters.
  22. NET_EXPORT base::Value QuicRequestNetLogParams(
  23. quic::QuicStreamId stream_id,
  24. const spdy::Http2HeaderBlock* headers,
  25. spdy::SpdyPriority priority,
  26. NetLogCaptureMode capture_mode);
  27. // Converts a spdy::Http2HeaderBlock and stream into NetLog event parameters.
  28. NET_EXPORT base::Value QuicResponseNetLogParams(
  29. quic::QuicStreamId stream_id,
  30. bool fin_received,
  31. const spdy::Http2HeaderBlock* headers,
  32. NetLogCaptureMode capture_mode);
  33. } // namespace net
  34. #endif // NET_QUIC_QUIC_HTTP_UTILS_H_