| 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" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "net/http/bidirectional_stream_impl.h" | 16 #include "net/http/bidirectional_stream_impl.h" |
| 17 #include "net/http/http_stream_factory.h" | 17 #include "net/http/http_stream_factory.h" |
| 18 #include "net/log/net_log.h" | 18 #include "net/log/net_log.h" |
| 19 | 19 |
| 20 class GURL; | 20 class GURL; |
| 21 | 21 |
| 22 namespace base { |
| 23 class TickClock; |
| 24 } // namespace base |
| 25 |
| 22 namespace net { | 26 namespace net { |
| 23 | 27 |
| 24 class HttpAuthController; | 28 class HttpAuthController; |
| 25 class HttpNetworkSession; | 29 class HttpNetworkSession; |
| 26 class HttpStream; | 30 class HttpStream; |
| 27 class HttpStreamRequest; | 31 class HttpStreamRequest; |
| 28 class IOBuffer; | 32 class IOBuffer; |
| 29 class ProxyInfo; | 33 class ProxyInfo; |
| 30 class SpdyHeaderBlock; | 34 class SpdyHeaderBlock; |
| 31 struct BidirectionalStreamRequestInfo; | 35 struct BidirectionalStreamRequestInfo; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 SSLCertRequestInfo* cert_info) override; | 215 SSLCertRequestInfo* cert_info) override; |
| 212 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, | 216 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, |
| 213 const SSLConfig& used_ssl_config, | 217 const SSLConfig& used_ssl_config, |
| 214 const ProxyInfo& used_proxy_info, | 218 const ProxyInfo& used_proxy_info, |
| 215 HttpStream* stream) override; | 219 HttpStream* stream) override; |
| 216 void OnQuicBroken() override; | 220 void OnQuicBroken() override; |
| 217 | 221 |
| 218 // Helper method to notify delegate if there is an error. | 222 // Helper method to notify delegate if there is an error. |
| 219 void NotifyFailed(int error); | 223 void NotifyFailed(int error); |
| 220 | 224 |
| 225 void UpdateHistograms(); |
| 226 |
| 221 // BidirectionalStreamRequestInfo used when requesting the stream. | 227 // BidirectionalStreamRequestInfo used when requesting the stream. |
| 222 std::unique_ptr<BidirectionalStreamRequestInfo> request_info_; | 228 std::unique_ptr<BidirectionalStreamRequestInfo> request_info_; |
| 223 const BoundNetLog net_log_; | 229 const BoundNetLog net_log_; |
| 224 | 230 |
| 225 HttpNetworkSession* session_; | 231 HttpNetworkSession* session_; |
| 226 | 232 |
| 227 bool send_request_headers_automatically_; | 233 bool send_request_headers_automatically_; |
| 228 // Whether request headers have been sent, as indicated in OnStreamReady() | 234 // Whether request headers have been sent, as indicated in OnStreamReady() |
| 229 // callback. | 235 // callback. |
| 230 bool request_headers_sent_; | 236 bool request_headers_sent_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 241 // non-NULL, if the |stream_request_| successfully finishes. | 247 // non-NULL, if the |stream_request_| successfully finishes. |
| 242 std::unique_ptr<BidirectionalStreamImpl> stream_impl_; | 248 std::unique_ptr<BidirectionalStreamImpl> stream_impl_; |
| 243 | 249 |
| 244 // Buffer used for reading. | 250 // Buffer used for reading. |
| 245 scoped_refptr<IOBuffer> read_buffer_; | 251 scoped_refptr<IOBuffer> read_buffer_; |
| 246 // List of buffers used for writing. | 252 // List of buffers used for writing. |
| 247 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; | 253 std::vector<scoped_refptr<IOBuffer>> write_buffer_list_; |
| 248 // List of buffer length. | 254 // List of buffer length. |
| 249 std::vector<int> write_buffer_len_list_; | 255 std::vector<int> write_buffer_len_list_; |
| 250 | 256 |
| 257 base::TimeTicks start_time_; |
| 258 base::TimeTicks recv_first_byte_time_; |
| 259 base::TimeTicks recv_last_byte_time_; |
| 260 |
| 261 std::unique_ptr<base::TickClock> tick_clock_; |
| 262 |
| 251 base::WeakPtrFactory<BidirectionalStream> weak_factory_; | 263 base::WeakPtrFactory<BidirectionalStream> weak_factory_; |
| 252 | 264 |
| 253 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 265 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
| 254 }; | 266 }; |
| 255 | 267 |
| 256 } // namespace net | 268 } // namespace net |
| 257 | 269 |
| 258 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 270 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
| OLD | NEW |