OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_BIDIRECTIONAL_STREAM_H_ | 5 #ifndef NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
mmenke
2016/06/06 19:34:00
include base/memory/weak_ptr.h.
xunjieli
2016/06/06 19:52:56
Done.
| |
15 #include "net/http/bidirectional_stream_impl.h" | 15 #include "net/http/bidirectional_stream_impl.h" |
16 #include "net/http/http_stream_factory.h" | 16 #include "net/http/http_stream_factory.h" |
17 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class HttpAuthController; | 23 class HttpAuthController; |
24 class HttpNetworkSession; | 24 class HttpNetworkSession; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 const ProxyInfo& used_proxy_info, | 209 const ProxyInfo& used_proxy_info, |
210 HttpAuthController* auth_controller) override; | 210 HttpAuthController* auth_controller) override; |
211 void OnNeedsClientAuth(const SSLConfig& used_ssl_config, | 211 void OnNeedsClientAuth(const SSLConfig& used_ssl_config, |
212 SSLCertRequestInfo* cert_info) override; | 212 SSLCertRequestInfo* cert_info) override; |
213 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, | 213 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, |
214 const SSLConfig& used_ssl_config, | 214 const SSLConfig& used_ssl_config, |
215 const ProxyInfo& used_proxy_info, | 215 const ProxyInfo& used_proxy_info, |
216 HttpStream* stream) override; | 216 HttpStream* stream) override; |
217 void OnQuicBroken() override; | 217 void OnQuicBroken() override; |
218 | 218 |
219 // Helper method to notify delegate if there is an error. | |
220 void NotifyError(int error); | |
221 | |
219 // BidirectionalStreamRequestInfo used when requesting the stream. | 222 // BidirectionalStreamRequestInfo used when requesting the stream. |
220 std::unique_ptr<BidirectionalStreamRequestInfo> request_info_; | 223 std::unique_ptr<BidirectionalStreamRequestInfo> request_info_; |
221 const BoundNetLog net_log_; | 224 const BoundNetLog net_log_; |
222 | 225 |
223 HttpNetworkSession* session_; | 226 HttpNetworkSession* session_; |
224 | 227 |
225 bool send_request_headers_automatically_; | 228 bool send_request_headers_automatically_; |
226 // Whether request headers have been sent, as indicated in OnStreamReady() | 229 // Whether request headers have been sent, as indicated in OnStreamReady() |
227 // callback. | 230 // callback. |
228 bool request_headers_sent_; | 231 bool request_headers_sent_; |
(...skipping 10 matching lines...) Expand all Loading... | |
239 // non-NULL, if the |stream_request_| successfully finishes. | 242 // non-NULL, if the |stream_request_| successfully finishes. |
240 std::unique_ptr<BidirectionalStreamImpl> stream_impl_; | 243 std::unique_ptr<BidirectionalStreamImpl> stream_impl_; |
241 | 244 |
242 // Buffer used for reading. | 245 // Buffer used for reading. |
243 scoped_refptr<IOBuffer> read_buffer_; | 246 scoped_refptr<IOBuffer> read_buffer_; |
244 // List of buffers used for writing. | 247 // List of buffers used for writing. |
245 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; | 248 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; |
246 // List of buffer length. | 249 // List of buffer length. |
247 std::vector<int> write_buffer_len_list_; | 250 std::vector<int> write_buffer_len_list_; |
248 | 251 |
252 base::WeakPtrFactory<BidirectionalStream> weak_factory_; | |
253 | |
249 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 254 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
250 }; | 255 }; |
251 | 256 |
252 } // namespace net | 257 } // namespace net |
253 | 258 |
254 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 259 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
OLD | NEW |