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 | |
38 LoadTimingObserver(); | 33 LoadTimingObserver(); |
39 ~LoadTimingObserver(); | 34 ~LoadTimingObserver(); |
40 | 35 |
41 URLRequestRecord* GetURLRequestRecord(uint32 source_id); | 36 URLRequestRecord* GetURLRequestRecord(uint32 source_id); |
42 | 37 |
43 // Observer implementation: | 38 // Observer implementation: |
44 virtual void OnAddEntry(net::NetLog::EventType type, | 39 virtual void OnAddEntry(net::NetLog::EventType type, |
45 const base::TimeTicks& time, | 40 const base::TimeTicks& time, |
46 const net::NetLog::Source& source, | 41 const net::NetLog::Source& source, |
47 net::NetLog::EventPhase phase, | 42 net::NetLog::EventPhase phase, |
48 net::NetLog::EventParameters* params); | 43 net::NetLog::EventParameters* params); |
49 private: | 44 private: |
50 void OnAddURLRequestEntry(net::NetLog::EventType type, | 45 void OnAddURLRequestEntry(net::NetLog::EventType type, |
51 const base::TimeTicks& time, | 46 const base::TimeTicks& time, |
52 const net::NetLog::Source& source, | 47 const net::NetLog::Source& source, |
53 net::NetLog::EventPhase phase, | 48 net::NetLog::EventPhase phase, |
54 net::NetLog::EventParameters* params); | 49 net::NetLog::EventParameters* params); |
55 | 50 |
56 void OnAddConnectJobEntry(net::NetLog::EventType type, | 51 void OnAddConnectJobEntry(net::NetLog::EventType type, |
57 const base::TimeTicks& time, | 52 const base::TimeTicks& time, |
58 const net::NetLog::Source& source, | 53 const net::NetLog::Source& source, |
59 net::NetLog::EventPhase phase, | 54 net::NetLog::EventPhase phase, |
60 net::NetLog::EventParameters* params); | 55 net::NetLog::EventParameters* params); |
61 | 56 |
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 | |
68 URLRequestRecord* CreateURLRequestRecord(uint32 source_id); | 57 URLRequestRecord* CreateURLRequestRecord(uint32 source_id); |
69 void DeleteURLRequestRecord(uint32 source_id); | 58 void DeleteURLRequestRecord(uint32 source_id); |
70 | 59 |
71 typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap; | 60 typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap; |
72 typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap; | 61 typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap; |
73 typedef base::hash_map<uint32, SocketRecord> SocketToRecordMap; | |
74 URLRequestToRecordMap url_request_to_record_; | 62 URLRequestToRecordMap url_request_to_record_; |
75 ConnectJobToRecordMap connect_job_to_record_; | 63 ConnectJobToRecordMap connect_job_to_record_; |
76 SocketToRecordMap socket_to_record_; | |
77 | 64 |
78 DISALLOW_COPY_AND_ASSIGN(LoadTimingObserver); | 65 DISALLOW_COPY_AND_ASSIGN(LoadTimingObserver); |
79 }; | 66 }; |
80 | 67 |
81 #endif // CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ | 68 #endif // CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_ |
OLD | NEW |