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

Unified Diff: chrome/browser/net/net_log_logger.h

Issue 6025017: Adds the ability to load JSON log files to about:net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Put load log button on its own line Created 9 years, 11 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/net/chrome_net_log.cc ('k') | chrome/browser/net/net_log_logger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/net_log_logger.h
===================================================================
--- chrome/browser/net/net_log_logger.h (revision 72508)
+++ chrome/browser/net/net_log_logger.h (working copy)
@@ -6,14 +6,23 @@
#define CHROME_BROWSER_NET_NET_LOG_LOGGER_H_
#pragma once
+#include "base/scoped_handle.h"
#include "chrome/browser/net/chrome_net_log.h"
+class FilePath;
+
// NetLogLogger watches the NetLog event stream, and sends all entries to
-// VLOG(1). This is to debug errors that prevent getting to the
-// about:net-internals page.
+// VLOG(1) or a path specified on creation. This is to debug errors that
+// prevent getting to the about:net-internals page.
+//
+// Relies on ChromeNetLog only calling an Observer once at a time for
+// thread-safety.
class NetLogLogger : public ChromeNetLog::ThreadSafeObserver {
public:
- NetLogLogger();
+ // If |log_path| is empty or file creation fails, writes to VLOG(1).
+ // Otherwise, writes to |log_path|. Uses one line per entry, for
+ // easy parsing.
+ explicit NetLogLogger(const FilePath &log_path);
~NetLogLogger();
// ThreadSafeObserver implementation:
@@ -24,6 +33,8 @@
net::NetLog::EventParameters* params);
private:
+ ScopedStdioHandle file_;
+
DISALLOW_COPY_AND_ASSIGN(NetLogLogger);
};
« no previous file with comments | « chrome/browser/net/chrome_net_log.cc ('k') | chrome/browser/net/net_log_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698