bidirectional_stream_request_info.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2015 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_HTTP_BIDIRECTIONAL_STREAM_REQUEST_INFO_H_
  5. #define NET_HTTP_BIDIRECTIONAL_STREAM_REQUEST_INFO_H_
  6. #include <string>
  7. #include "base/time/time.h"
  8. #include "net/base/net_export.h"
  9. #include "net/base/request_priority.h"
  10. #include "net/http/http_request_headers.h"
  11. #include "net/socket/socket_tag.h"
  12. #include "url/gurl.h"
  13. namespace net {
  14. // Struct containing information needed to request a BidirectionalStream.
  15. struct NET_EXPORT BidirectionalStreamRequestInfo {
  16. BidirectionalStreamRequestInfo();
  17. ~BidirectionalStreamRequestInfo();
  18. // The requested URL.
  19. GURL url;
  20. // The method to use (GET, POST, etc.).
  21. std::string method;
  22. // Whether to allow early data to be used with this request, overriding the
  23. // early data based on the |method| semantics.
  24. bool allow_early_data_override = false;
  25. // Request priority.
  26. RequestPriority priority = LOW;
  27. // Socket tag to apply to sockets used to process this request.
  28. SocketTag socket_tag;
  29. // Any extra request headers (including User-Agent).
  30. HttpRequestHeaders extra_headers;
  31. // Whether END_STREAM should be set on the request HEADER frame.
  32. bool end_stream_on_headers = false;
  33. // Whether the implementor of the BidirectionalStream should monitor
  34. // the status of the connection for the lifetime of this stream.
  35. bool detect_broken_connection = false;
  36. // Suggests the period the broken connection detector should use to check
  37. // the status of the connection.
  38. base::TimeDelta heartbeat_interval;
  39. };
  40. } // namespace net
  41. #endif // NET_HTTP_BIDIRECTIONAL_STREAM_REQUEST_INFO_H_