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

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

Issue 10399083: Make NetLog take in callbacks that return Values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix merge error Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 CONTENT_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 6 #define CONTENT_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/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 13 matching lines...) Expand all
24 // actual HTTP/SPDY headers sent and received over the network. 24 // actual HTTP/SPDY headers sent and received over the network.
25 // 25 //
26 // As DevToolsNetLogObserver shares live data with objects that live on the 26 // As DevToolsNetLogObserver shares live data with objects that live on the
27 // IO Thread, it must also reside on the IO Thread. Only OnAddEntry can be 27 // IO Thread, it must also reside on the IO Thread. Only OnAddEntry can be
28 // called from other threads. 28 // called from other threads.
29 class DevToolsNetLogObserver : public net::NetLog::ThreadSafeObserver { 29 class DevToolsNetLogObserver : public net::NetLog::ThreadSafeObserver {
30 typedef webkit_glue::ResourceDevToolsInfo ResourceInfo; 30 typedef webkit_glue::ResourceDevToolsInfo ResourceInfo;
31 31
32 public: 32 public:
33 // net::NetLog::ThreadSafeObserver implementation: 33 // net::NetLog::ThreadSafeObserver implementation:
34 virtual void OnAddEntry(net::NetLog::EventType type, 34 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
35 const base::TimeTicks& time,
36 const net::NetLog::Source& source,
37 net::NetLog::EventPhase phase,
38 net::NetLog::EventParameters* params) OVERRIDE;
39 35
40 void OnAddURLRequestEntry(net::NetLog::EventType type, 36 void OnAddURLRequestEntry(const net::NetLog::Entry& entry);
41 const base::TimeTicks& time, 37 void OnAddHTTPStreamJobEntry(const net::NetLog::Entry& entry);
42 const net::NetLog::Source& source, 38 void OnAddSocketEntry(const net::NetLog::Entry& entry);
43 net::NetLog::EventPhase phase,
44 net::NetLog::EventParameters* params);
45
46 void OnAddHTTPStreamJobEntry(net::NetLog::EventType type,
47 const base::TimeTicks& time,
48 const net::NetLog::Source& source,
49 net::NetLog::EventPhase phase,
50 net::NetLog::EventParameters* params);
51
52 void OnAddSocketEntry(net::NetLog::EventType type,
53 const base::TimeTicks& time,
54 const net::NetLog::Source& source,
55 net::NetLog::EventPhase phase,
56 net::NetLog::EventParameters* params);
57 39
58 static void Attach(); 40 static void Attach();
59 static void Detach(); 41 static void Detach();
60 42
61 // Must be called on the IO thread. May return NULL if no observers 43 // Must be called on the IO thread. May return NULL if no observers
62 // are active. 44 // are active.
63 static DevToolsNetLogObserver* GetInstance(); 45 static DevToolsNetLogObserver* GetInstance();
64 static void PopulateResponseInfo(net::URLRequest*, 46 static void PopulateResponseInfo(net::URLRequest*,
65 content::ResourceResponse*); 47 content::ResourceResponse*);
66 static int GetAndResetEncodedDataLength(net::URLRequest* request); 48 static int GetAndResetEncodedDataLength(net::URLRequest* request);
(...skipping 12 matching lines...) Expand all
79 typedef base::hash_map<uint32, uint32> SocketToRequestMap; 61 typedef base::hash_map<uint32, uint32> SocketToRequestMap;
80 RequestToInfoMap request_to_info_; 62 RequestToInfoMap request_to_info_;
81 RequestToEncodedDataLengthMap request_to_encoded_data_length_; 63 RequestToEncodedDataLengthMap request_to_encoded_data_length_;
82 HTTPStreamJobToSocketMap http_stream_job_to_socket_; 64 HTTPStreamJobToSocketMap http_stream_job_to_socket_;
83 SocketToRequestMap socket_to_request_; 65 SocketToRequestMap socket_to_request_;
84 66
85 DISALLOW_COPY_AND_ASSIGN(DevToolsNetLogObserver); 67 DISALLOW_COPY_AND_ASSIGN(DevToolsNetLogObserver);
86 }; 68 };
87 69
88 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_ 70 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | content/browser/debugger/devtools_netlog_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698