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

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

Issue 11635023: First cut at UI for saving net_logs data into a temporary file on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 12 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
Index: chrome/browser/net/net_log_logger.cc
===================================================================
--- chrome/browser/net/net_log_logger.cc (revision 175049)
+++ chrome/browser/net/net_log_logger.cc (working copy)
@@ -14,7 +14,7 @@
#include "base/values.h"
#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
-NetLogLogger::NetLogLogger(const FilePath &log_path) {
+NetLogLogger::NetLogLogger(const FilePath &log_path) : net_log_(NULL) {
if (!log_path.empty()) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
FILE* fp = file_util::OpenFile(log_path, "w");
@@ -41,8 +41,15 @@
void NetLogLogger::StartObserving(net::NetLog* net_log) {
net_log->AddThreadSafeObserver(this, net::NetLog::LOG_ALL_BUT_BYTES);
+ net_log_ = net_log;
}
+void NetLogLogger::StopObserving() {
+ DCHECK(net_log_);
+ net_log_->RemoveThreadSafeObserver(this);
+ net_log_ = NULL;
+}
+
void NetLogLogger::OnAddEntry(const net::NetLog::Entry& entry) {
scoped_ptr<Value> value(entry.ToValue());
// Don't pretty print, so each JSON value occupies a single line, with no

Powered by Google App Engine
This is Rietveld 408576698