OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef LOAD_TIMING_INFO_H_ |
| 6 #define LOAD_TIMING_INFO_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/time.h" |
| 10 #include "net/base/net_export.h" |
| 11 |
| 12 namespace net { |
| 13 |
| 14 // All events that do not apply to a request are NULL. For non-HTTP requests, |
| 15 // all times other than the request_start times are NULL. |
| 16 // |
| 17 // The general order for events is: |
| 18 // request_start |
| 19 // proxy_start |
| 20 // proxy_end |
| 21 // *dns_start |
| 22 // *dns_end |
| 23 // *connect_start |
| 24 // *ssl_start |
| 25 // *connect_end |
| 26 // send_start |
| 27 // send_end |
| 28 // receive_headers_end |
| 29 // |
| 30 // Due to preconnect, late-binding, and cancelled requests, a request may use a |
| 31 // fresh connection that was started before the request was issued. In this |
| 32 // case, while the events without a * will always appear in the same order |
| 33 // relative to each other, and those with a * will as well, starred events may |
| 34 // occur before, during, or after request_start and proxy events. socket_reused |
| 35 // will be false in this case. |
| 36 struct NET_EXPORT LoadTimingInfo { |
| 37 LoadTimingInfo(); |
| 38 ~LoadTimingInfo(); |
| 39 |
| 40 // True if the socket was reused. When true, DNS, connect, and SSL times |
| 41 // will all be NULL. When false, those times may be NULL, too, if the socket |
| 42 // was preconnected. |
| 43 bool socket_reused; |
| 44 |
| 45 // Unique socket ID, can be used to identify requests served by the same |
| 46 // socket. |
| 47 // TODO(mmenke): Do something reasonable for SPDY proxies. |
| 48 uint32 socket_log_id; |
| 49 |
| 50 base::Time request_start_time; |
| 51 base::TimeTicks request_start; |
| 52 |
| 53 // The time spent determing which proxy to use. |
| 54 base::TimeTicks proxy_start; |
| 55 base::TimeTicks proxy_end; |
| 56 |
| 57 // The time spent looking up the host's DNS address. NULL for requests that |
| 58 // used proxies to look up the DNS address. Also NULL for SOCKS4 proxies, |
| 59 // since the DNS address is only looked up after the connection is |
| 60 // established, which results in unexpected event ordering. |
| 61 base::TimeTicks dns_start; |
| 62 base::TimeTicks dns_end; |
| 63 |
| 64 // The time spent establishing the connection started. Connect time includes |
| 65 // proxy DNS lookup times, blocking, TCP, TCP retries and SSL time. |
| 66 base::TimeTicks connect_start; |
| 67 base::TimeTicks connect_end; |
| 68 |
| 69 // The time when the SSL handshake started / completed. For non-HTTPS requests |
| 70 // these are NULL. These times are only for the SSL connection to the final |
| 71 // destination server, not an SSL/SPDY proxy. |
| 72 base::TimeTicks ssl_start; |
| 73 base::TimeTicks ssl_end; |
| 74 |
| 75 // The time that sending HTTP request started / ended. |
| 76 base::TimeTicks send_start; |
| 77 base::TimeTicks send_end; |
| 78 |
| 79 // The time at which the end of the HTTP headers were received. |
| 80 base::TimeTicks receive_headers_end; |
| 81 }; |
| 82 |
| 83 } // namespace net |
| 84 |
| 85 #endif // LOAD_TIMING_INFO_H_ |
OLD | NEW |