OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ |
6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual void SetPriority(RequestPriority priority) = 0; | 45 virtual void SetPriority(RequestPriority priority) = 0; |
46 }; | 46 }; |
47 | 47 |
48 // Request will notify |job_controller| when it's destructed. | 48 // Request will notify |job_controller| when it's destructed. |
49 // Thus |job_controller| is valid for the lifetime of the |this| Request. | 49 // Thus |job_controller| is valid for the lifetime of the |this| Request. |
50 Request(const GURL& url, | 50 Request(const GURL& url, |
51 Helper* helper, | 51 Helper* helper, |
52 HttpStreamRequest::Delegate* delegate, | 52 HttpStreamRequest::Delegate* delegate, |
53 WebSocketHandshakeStreamBase::CreateHelper* | 53 WebSocketHandshakeStreamBase::CreateHelper* |
54 websocket_handshake_stream_create_helper, | 54 websocket_handshake_stream_create_helper, |
55 const BoundNetLog& net_log, | 55 const NetLogWithSource& net_log, |
56 StreamType stream_type); | 56 StreamType stream_type); |
57 | 57 |
58 ~Request() override; | 58 ~Request() override; |
59 | 59 |
60 // The GURL from the HttpRequestInfo the started the Request. | 60 // The GURL from the HttpRequestInfo the started the Request. |
61 const GURL& url() const { return url_; } | 61 const GURL& url() const { return url_; } |
62 | 62 |
63 const BoundNetLog& net_log() const { return net_log_; } | 63 const NetLogWithSource& net_log() const { return net_log_; } |
64 | 64 |
65 // Called when the |helper_| determines the appropriate |spdy_session_key| | 65 // Called when the |helper_| determines the appropriate |spdy_session_key| |
66 // for the Request. Note that this does not mean that SPDY is necessarily | 66 // for the Request. Note that this does not mean that SPDY is necessarily |
67 // supported for this SpdySessionKey, since we may need to wait for NPN to | 67 // supported for this SpdySessionKey, since we may need to wait for NPN to |
68 // complete before knowing if SPDY is available. | 68 // complete before knowing if SPDY is available. |
69 void SetSpdySessionKey(const SpdySessionKey& spdy_session_key); | 69 void SetSpdySessionKey(const SpdySessionKey& spdy_session_key); |
70 bool HasSpdySessionKey() const; | 70 bool HasSpdySessionKey() const; |
71 | 71 |
72 // Marks completion of the request. Must be called before OnStreamReady(). | 72 // Marks completion of the request. Must be called before OnStreamReady(). |
73 void Complete(bool was_alpn_negotiated, | 73 void Complete(bool was_alpn_negotiated, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 private: | 131 private: |
132 const GURL url_; | 132 const GURL url_; |
133 | 133 |
134 // Unowned. The helper must outlive this request. | 134 // Unowned. The helper must outlive this request. |
135 Helper* helper_; | 135 Helper* helper_; |
136 | 136 |
137 WebSocketHandshakeStreamBase::CreateHelper* const | 137 WebSocketHandshakeStreamBase::CreateHelper* const |
138 websocket_handshake_stream_create_helper_; | 138 websocket_handshake_stream_create_helper_; |
139 HttpStreamRequest::Delegate* const delegate_; | 139 HttpStreamRequest::Delegate* const delegate_; |
140 const BoundNetLog net_log_; | 140 const NetLogWithSource net_log_; |
141 | 141 |
142 std::unique_ptr<const SpdySessionKey> spdy_session_key_; | 142 std::unique_ptr<const SpdySessionKey> spdy_session_key_; |
143 | 143 |
144 bool completed_; | 144 bool completed_; |
145 bool was_alpn_negotiated_; | 145 bool was_alpn_negotiated_; |
146 // Protocol negotiated with the server. | 146 // Protocol negotiated with the server. |
147 NextProto negotiated_protocol_; | 147 NextProto negotiated_protocol_; |
148 bool using_spdy_; | 148 bool using_spdy_; |
149 ConnectionAttempts connection_attempts_; | 149 ConnectionAttempts connection_attempts_; |
150 | 150 |
151 const HttpStreamRequest::StreamType stream_type_; | 151 const HttpStreamRequest::StreamType stream_type_; |
152 DISALLOW_COPY_AND_ASSIGN(Request); | 152 DISALLOW_COPY_AND_ASSIGN(Request); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace net | 155 } // namespace net |
156 | 156 |
157 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ | 157 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_ |
OLD | NEW |