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

Side by Side Diff: chrome/browser/debugger/devtools_netlog_observer.h

Issue 4118004: Update NetLog to be thread safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments Created 10 years, 1 month 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
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_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
11 #include "chrome/browser/net/chrome_net_log.h" 11 #include "chrome/browser/net/chrome_net_log.h"
12 #include "webkit/glue/resource_loader_bridge.h" 12 #include "webkit/glue/resource_loader_bridge.h"
13 13
14 class IOThread; 14 class IOThread;
15 class URLRequest; 15 class URLRequest;
16 struct ResourceResponse; 16 struct ResourceResponse;
17 17
18 // DevToolsNetLogObserver watches the NetLog event stream and collects the 18 // DevToolsNetLogObserver watches the NetLog event stream and collects the
19 // stuff that may be of interest to DevTools. Currently, this only includes 19 // stuff that may be of interest to DevTools. Currently, this only includes
20 // actual HTTP/SPDY headers sent and received over the network. 20 // actual HTTP/SPDY headers sent and received over the network.
21 //
22 // As DevToolsNetLogObserver shares live data with objects that live on the
23 // IO Thread, it must also reside on the IO Thread. Only OnAddEntry can be
24 // called from other threads.
21 class DevToolsNetLogObserver: public ChromeNetLog::Observer { 25 class DevToolsNetLogObserver: public ChromeNetLog::Observer {
22 typedef webkit_glue::ResourceDevToolsInfo ResourceInfo; 26 typedef webkit_glue::ResourceDevToolsInfo ResourceInfo;
23 27
24 public: 28 public:
25 // Observer implementation: 29 // Observer implementation:
26 virtual void OnAddEntry(net::NetLog::EventType type, 30 virtual void OnAddEntry(net::NetLog::EventType type,
27 const base::TimeTicks& time, 31 const base::TimeTicks& time,
28 const net::NetLog::Source& source, 32 const net::NetLog::Source& source,
29 net::NetLog::EventPhase phase, 33 net::NetLog::EventPhase phase,
30 net::NetLog::EventParameters* params); 34 net::NetLog::EventParameters* params);
(...skipping 17 matching lines...) Expand all
48 52
49 ResourceInfo* GetResourceInfo(uint32 id); 53 ResourceInfo* GetResourceInfo(uint32 id);
50 54
51 ChromeNetLog* chrome_net_log_; 55 ChromeNetLog* chrome_net_log_;
52 RequestToInfoMap request_to_info_; 56 RequestToInfoMap request_to_info_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(DevToolsNetLogObserver); 58 DISALLOW_COPY_AND_ASSIGN(DevToolsNetLogObserver);
55 }; 59 };
56 60
57 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 61 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698