From d5cbd92ad951a1c2c24cafebab8bbf3d084b1378 Mon Sep 17 00:00:00 2001 From: "mmenke@chromium.org" Date: Wed, 29 Feb 2012 12:43:23 +0000 Subject: Remove the ChromeNetLog observer classes, using NetLog::ThreadSafeObserver instead, slightly modifying the NetLog interface to do so. R=eroman@chromium.org BUG=114611 Review URL: http://codereview.chromium.org/9415013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124176 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/net/net_log_logger.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'chrome/browser/net/net_log_logger.cc') diff --git a/chrome/browser/net/net_log_logger.cc b/chrome/browser/net/net_log_logger.cc index c52abf7..bc9cd6a 100644 --- a/chrome/browser/net/net_log_logger.cc +++ b/chrome/browser/net/net_log_logger.cc @@ -8,13 +8,13 @@ #include "base/file_util.h" #include "base/json/json_writer.h" +#include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/threading/thread_restrictions.h" #include "base/values.h" #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" -NetLogLogger::NetLogLogger(const FilePath &log_path) - : ThreadSafeObserverImpl(net::NetLog::LOG_ALL_BUT_BYTES) { +NetLogLogger::NetLogLogger(const FilePath &log_path) { if (!log_path.empty()) { base::ThreadRestrictions::ScopedAllowIO allow_io; file_.Set(file_util::OpenFile(log_path, "w")); @@ -33,6 +33,10 @@ NetLogLogger::NetLogLogger(const FilePath &log_path) NetLogLogger::~NetLogLogger() { } +void NetLogLogger::StartObserving(net::NetLog* net_log) { + net_log->AddThreadSafeObserver(this, net::NetLog::LOG_ALL_BUT_BYTES); +} + void NetLogLogger::OnAddEntry(net::NetLog::EventType type, const base::TimeTicks& time, const net::NetLog::Source& source, -- cgit v1.1