Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/net/load_timing_observer.h

Issue 2909016: DevTools & WebTiming : Migrate from PassiveLogCollector to dedicated LoadTimingObserver. (Closed)
Patch Set: Fixed tests. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/chrome_net_log.cc ('k') | chrome/browser/net/load_timing_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_
6 #define CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_
7
8 #include "base/hash_tables.h"
9 #include "base/time.h"
10 #include "chrome/browser/net/chrome_net_log.h"
11 #include "net/base/net_log.h"
12 #include "webkit/glue/resource_loader_bridge.h"
13
14 // LoadTimingObserver watches the NetLog event stream and collects the network
15 // timing information.
16 class LoadTimingObserver : public ChromeNetLog::Observer {
17 public:
18 struct URLRequestRecord {
19 URLRequestRecord();
20
21 webkit_glue::ResourceLoaderBridge::LoadTimingInfo timing;
22 uint32 connect_job_id;
23 uint32 socket_log_id;
24 bool socket_reused;
25 base::TimeTicks base_ticks;
26 };
27
28 struct ConnectJobRecord {
29 base::TimeTicks dns_start;
30 base::TimeTicks dns_end;
31 };
32
33 LoadTimingObserver();
34 ~LoadTimingObserver();
35
36 URLRequestRecord* GetURLRequestRecord(uint32 source_id);
37
38 // Observer implementation:
39 virtual void OnAddEntry(net::NetLog::EventType type,
40 const base::TimeTicks& time,
41 const net::NetLog::Source& source,
42 net::NetLog::EventPhase phase,
43 net::NetLog::EventParameters* params);
44 private:
45 void OnAddURLRequestEntry(net::NetLog::EventType type,
46 const base::TimeTicks& time,
47 const net::NetLog::Source& source,
48 net::NetLog::EventPhase phase,
49 net::NetLog::EventParameters* params);
50
51 void OnAddConnectJobEntry(net::NetLog::EventType type,
52 const base::TimeTicks& time,
53 const net::NetLog::Source& source,
54 net::NetLog::EventPhase phase,
55 net::NetLog::EventParameters* params);
56
57 URLRequestRecord* CreateURLRequestRecord(uint32 source_id);
58 void DeleteURLRequestRecord(uint32 source_id);
59
60 typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap;
61 typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap;
62 URLRequestToRecordMap url_request_to_record_;
63 ConnectJobToRecordMap connect_job_to_record_;
64
65 DISALLOW_COPY_AND_ASSIGN(LoadTimingObserver);
66 };
67
68 #endif // CHROME_BROWSER_NET_LOAD_TIMING_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_net_log.cc ('k') | chrome/browser/net/load_timing_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698