| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int DoWriteHeadersComplete(int result); | 81 int DoWriteHeadersComplete(int result); |
| 82 int DoWriteBody(); | 82 int DoWriteBody(); |
| 83 int DoWriteBodyComplete(int result); | 83 int DoWriteBodyComplete(int result); |
| 84 int DoReadHeaders(); | 84 int DoReadHeaders(); |
| 85 int DoReadHeadersComplete(int result); | 85 int DoReadHeadersComplete(int result); |
| 86 int DoReadBody(); | 86 int DoReadBody(); |
| 87 int DoReadBodyComplete(int result); | 87 int DoReadBodyComplete(int result); |
| 88 int DoDrainBodyForAuthRestart(); | 88 int DoDrainBodyForAuthRestart(); |
| 89 int DoDrainBodyForAuthRestartComplete(int result); | 89 int DoDrainBodyForAuthRestartComplete(int result); |
| 90 | 90 |
| 91 // Record histogram of time to acquire a TCP connection. | 91 // Record histograms of latency until Connect() completes. |
| 92 void LogTCPConnectionMetrics() const; | 92 void LogTCPConnectedMetrics() const; |
| 93 | 93 |
| 94 // Record histogram of time until first byte of header is received. | 94 // Record histogram of time until first byte of header is received. |
| 95 void LogTransactionConnectedMetrics() const; | 95 void LogTransactionConnectedMetrics() const; |
| 96 | 96 |
| 97 // Record histogram of latency (durations until last byte received). | 97 // Record histogram of latency (durations until last byte received). |
| 98 void LogTransactionMetrics() const; | 98 void LogTransactionMetrics() const; |
| 99 | 99 |
| 100 // Writes a log message to help debugging in the field when we block a proxy | 100 // Writes a log message to help debugging in the field when we block a proxy |
| 101 // response to a CONNECT request. | 101 // response to a CONNECT request. |
| 102 void LogBlockedTunnelResponse(int response_code) const; | 102 void LogBlockedTunnelResponse(int response_code) const; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // User buffer and length passed to the Read method. | 316 // User buffer and length passed to the Read method. |
| 317 scoped_refptr<IOBuffer> read_buf_; | 317 scoped_refptr<IOBuffer> read_buf_; |
| 318 int read_buf_len_; | 318 int read_buf_len_; |
| 319 | 319 |
| 320 // The time the Start method was called. | 320 // The time the Start method was called. |
| 321 base::Time start_time_; | 321 base::Time start_time_; |
| 322 | 322 |
| 323 // The time the Connect() method was called (if it got called). | 323 // The time the Connect() method was called (if it got called). |
| 324 base::Time connect_start_time_; | 324 base::Time connect_start_time_; |
| 325 | 325 |
| 326 // The time the host resolution started (if it indeed got started). |
| 327 base::Time host_resolution_start_time_; |
| 328 |
| 326 enum State { | 329 enum State { |
| 327 STATE_RESOLVE_PROXY, | 330 STATE_RESOLVE_PROXY, |
| 328 STATE_RESOLVE_PROXY_COMPLETE, | 331 STATE_RESOLVE_PROXY_COMPLETE, |
| 329 STATE_INIT_CONNECTION, | 332 STATE_INIT_CONNECTION, |
| 330 STATE_INIT_CONNECTION_COMPLETE, | 333 STATE_INIT_CONNECTION_COMPLETE, |
| 331 STATE_RESOLVE_HOST, | 334 STATE_RESOLVE_HOST, |
| 332 STATE_RESOLVE_HOST_COMPLETE, | 335 STATE_RESOLVE_HOST_COMPLETE, |
| 333 STATE_TCP_CONNECT, | 336 STATE_TCP_CONNECT, |
| 334 STATE_TCP_CONNECT_COMPLETE, | 337 STATE_TCP_CONNECT_COMPLETE, |
| 335 STATE_SSL_CONNECT, | 338 STATE_SSL_CONNECT, |
| 336 STATE_SSL_CONNECT_COMPLETE, | 339 STATE_SSL_CONNECT_COMPLETE, |
| 337 STATE_WRITE_HEADERS, | 340 STATE_WRITE_HEADERS, |
| 338 STATE_WRITE_HEADERS_COMPLETE, | 341 STATE_WRITE_HEADERS_COMPLETE, |
| 339 STATE_WRITE_BODY, | 342 STATE_WRITE_BODY, |
| 340 STATE_WRITE_BODY_COMPLETE, | 343 STATE_WRITE_BODY_COMPLETE, |
| 341 STATE_READ_HEADERS, | 344 STATE_READ_HEADERS, |
| 342 STATE_READ_HEADERS_COMPLETE, | 345 STATE_READ_HEADERS_COMPLETE, |
| 343 STATE_READ_BODY, | 346 STATE_READ_BODY, |
| 344 STATE_READ_BODY_COMPLETE, | 347 STATE_READ_BODY_COMPLETE, |
| 345 STATE_DRAIN_BODY_FOR_AUTH_RESTART, | 348 STATE_DRAIN_BODY_FOR_AUTH_RESTART, |
| 346 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, | 349 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, |
| 347 STATE_NONE | 350 STATE_NONE |
| 348 }; | 351 }; |
| 349 State next_state_; | 352 State next_state_; |
| 350 }; | 353 }; |
| 351 | 354 |
| 352 } // namespace net | 355 } // namespace net |
| 353 | 356 |
| 354 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 357 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |