| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/net/net_log_logger.h" | 5 #include "chrome/browser/net/net_log_logger.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 NetLogLogger::NetLogLogger() : Observer(net::NetLog::LOG_ALL_BUT_BYTES) {} | 10 NetLogLogger::NetLogLogger() |
| 11 : ThreadSafeObserver(net::NetLog::LOG_ALL_BUT_BYTES) { |
| 12 } |
| 11 | 13 |
| 12 NetLogLogger::~NetLogLogger() {} | 14 NetLogLogger::~NetLogLogger() {} |
| 13 | 15 |
| 14 void NetLogLogger::OnAddEntry(net::NetLog::EventType type, | 16 void NetLogLogger::OnAddEntry(net::NetLog::EventType type, |
| 15 const base::TimeTicks& time, | 17 const base::TimeTicks& time, |
| 16 const net::NetLog::Source& source, | 18 const net::NetLog::Source& source, |
| 17 net::NetLog::EventPhase phase, | 19 net::NetLog::EventPhase phase, |
| 18 net::NetLog::EventParameters* params) { | 20 net::NetLog::EventParameters* params) { |
| 19 scoped_ptr<Value> value(net::NetLog::EntryToDictionaryValue(type, time, | 21 scoped_ptr<Value> value(net::NetLog::EntryToDictionaryValue(type, time, |
| 20 source, phase, | 22 source, phase, |
| 21 params, true)); | 23 params, true)); |
| 22 std::string json; | 24 std::string json; |
| 23 base::JSONWriter::Write(value.get(), true, &json); | 25 base::JSONWriter::Write(value.get(), true, &json); |
| 24 VLOG(1) << json; | 26 VLOG(1) << json; |
| 25 } | 27 } |
| 26 | 28 |
| OLD | NEW |