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