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

Unified Diff: chrome/browser/debugger/devtools_netlog_observer.h

Issue 3133016: Support retrieval of raw headers from network stack (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: nits picked Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/debugger/devtools_manager.cc ('k') | chrome/browser/debugger/devtools_netlog_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/debugger/devtools_netlog_observer.h
diff --git a/chrome/browser/debugger/devtools_netlog_observer.h b/chrome/browser/debugger/devtools_netlog_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..501ff5d40c220017979cb92035b27ad774181992
--- /dev/null
+++ b/chrome/browser/debugger/devtools_netlog_observer.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
+#define CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
+#pragma once
+
+#include "base/hash_tables.h"
+#include "base/ref_counted.h"
+#include "chrome/browser/net/chrome_net_log.h"
+#include "webkit/glue/resource_loader_bridge.h"
+
+class IOThread;
+class URLRequest;
+struct ResourceResponse;
+
+// DevToolsNetLogObserver watches the NetLog event stream and collects the
+// stuff that may be of interest to DevTools. Currently, this only includes
+// actual HTTP/SPDY headers sent and received over the network.
+class DevToolsNetLogObserver: public ChromeNetLog::Observer {
+ typedef webkit_glue::ResourceLoaderBridge::DevToolsInfo ResourceInfo;
+
+ public:
+ // Observer implementation:
+ virtual void OnAddEntry(net::NetLog::EventType type,
+ const base::TimeTicks& time,
+ const net::NetLog::Source& source,
+ net::NetLog::EventPhase phase,
+ net::NetLog::EventParameters* params);
+
+ static void Attach(IOThread* thread);
+ static void Detach();
+
+ // Must be called on the IO thread. May return NULL if no observers
+ // are active.
+ static DevToolsNetLogObserver* GetInstance();
+ static void PopulateResponseInfo(URLRequest*, ResourceResponse*);
+
+ private:
+ typedef base::hash_map<uint32, scoped_refptr<ResourceInfo> >
+ RequestToInfoMap;
+
+ static DevToolsNetLogObserver* instance_;
+
+ explicit DevToolsNetLogObserver(ChromeNetLog* chrome_net_log);
+ ~DevToolsNetLogObserver();
+
+ ResourceInfo* GetResourceInfo(uint32 id);
+
+ ChromeNetLog* chrome_net_log_;
+ RequestToInfoMap request_to_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsNetLogObserver);
+};
+
+#endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_NETLOG_OBSERVER_H_
« no previous file with comments | « chrome/browser/debugger/devtools_manager.cc ('k') | chrome/browser/debugger/devtools_netlog_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698