Chromium Code Reviews| 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 | |
|
mef
2016/08/10 01:05:20
Add class TimeTicks?
xunjieli
2016/08/11 12:50:40
Done. I included the header file instead since tha
| |
| 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 read_start_time_; | |
| 259 base::TimeTicks read_end_time_; | |
| 260 base::TimeTicks send_start_time_; | |
| 261 base::TimeTicks send_end_time_; | |
| 262 | |
| 263 std::unique_ptr<base::TickClock> tick_clock_; | |
| 264 | |
| 251 base::WeakPtrFactory<BidirectionalStream> weak_factory_; | 265 base::WeakPtrFactory<BidirectionalStream> weak_factory_; |
| 252 | 266 |
| 253 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 267 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
| 254 }; | 268 }; |
| 255 | 269 |
| 256 } // namespace net | 270 } // namespace net |
| 257 | 271 |
| 258 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 272 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
| OLD | NEW |