OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ |
6 #define CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ | 6 #define CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/net/chrome_net_log.h" | 10 #include "chrome/browser/net/chrome_net_log.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 uint32 socket_log_id; | 23 uint32 socket_log_id; |
24 bool socket_reused; | 24 bool socket_reused; |
25 base::TimeTicks base_ticks; | 25 base::TimeTicks base_ticks; |
26 }; | 26 }; |
27 | 27 |
28 struct ConnectJobRecord { | 28 struct ConnectJobRecord { |
29 base::TimeTicks dns_start; | 29 base::TimeTicks dns_start; |
30 base::TimeTicks dns_end; | 30 base::TimeTicks dns_end; |
31 }; | 31 }; |
32 | 32 |
| 33 struct SocketRecord { |
| 34 base::TimeTicks ssl_start; |
| 35 base::TimeTicks ssl_end; |
| 36 }; |
| 37 |
33 LoadTimingObserver(); | 38 LoadTimingObserver(); |
34 ~LoadTimingObserver(); | 39 ~LoadTimingObserver(); |
35 | 40 |
36 URLRequestRecord* GetURLRequestRecord(uint32 source_id); | 41 URLRequestRecord* GetURLRequestRecord(uint32 source_id); |
37 | 42 |
38 // Observer implementation: | 43 // Observer implementation: |
39 virtual void OnAddEntry(net::NetLog::EventType type, | 44 virtual void OnAddEntry(net::NetLog::EventType type, |
40 const base::TimeTicks& time, | 45 const base::TimeTicks& time, |
41 const net::NetLog::Source& source, | 46 const net::NetLog::Source& source, |
42 net::NetLog::EventPhase phase, | 47 net::NetLog::EventPhase phase, |
43 net::NetLog::EventParameters* params); | 48 net::NetLog::EventParameters* params); |
44 private: | 49 private: |
45 void OnAddURLRequestEntry(net::NetLog::EventType type, | 50 void OnAddURLRequestEntry(net::NetLog::EventType type, |
46 const base::TimeTicks& time, | 51 const base::TimeTicks& time, |
47 const net::NetLog::Source& source, | 52 const net::NetLog::Source& source, |
48 net::NetLog::EventPhase phase, | 53 net::NetLog::EventPhase phase, |
49 net::NetLog::EventParameters* params); | 54 net::NetLog::EventParameters* params); |
50 | 55 |
51 void OnAddConnectJobEntry(net::NetLog::EventType type, | 56 void OnAddConnectJobEntry(net::NetLog::EventType type, |
52 const base::TimeTicks& time, | 57 const base::TimeTicks& time, |
53 const net::NetLog::Source& source, | 58 const net::NetLog::Source& source, |
54 net::NetLog::EventPhase phase, | 59 net::NetLog::EventPhase phase, |
55 net::NetLog::EventParameters* params); | 60 net::NetLog::EventParameters* params); |
56 | 61 |
| 62 void OnAddSocketEntry(net::NetLog::EventType type, |
| 63 const base::TimeTicks& time, |
| 64 const net::NetLog::Source& source, |
| 65 net::NetLog::EventPhase phase, |
| 66 net::NetLog::EventParameters* params); |
| 67 |
57 URLRequestRecord* CreateURLRequestRecord(uint32 source_id); | 68 URLRequestRecord* CreateURLRequestRecord(uint32 source_id); |
58 void DeleteURLRequestRecord(uint32 source_id); | 69 void DeleteURLRequestRecord(uint32 source_id); |
59 | 70 |
60 typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap; | 71 typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap; |
61 typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap; | 72 typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap; |
| 73 typedef base::hash_map<uint32, SocketRecord> SocketToRecordMap; |
62 URLRequestToRecordMap url_request_to_record_; | 74 URLRequestToRecordMap url_request_to_record_; |
63 ConnectJobToRecordMap connect_job_to_record_; | 75 ConnectJobToRecordMap connect_job_to_record_; |
| 76 SocketToRecordMap socket_to_record_; |
64 | 77 |
65 DISALLOW_COPY_AND_ASSIGN(LoadTimingObserver); | 78 DISALLOW_COPY_AND_ASSIGN(LoadTimingObserver); |
66 }; | 79 }; |
67 | 80 |
68 #endif // CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ | 81 #endif // CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ |
OLD | NEW |