Index: remoting/host/dev_net_log.cc |
diff --git a/remoting/host/dev_net_log.cc b/remoting/host/dev_net_log.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2c3e4d2d4d0cc383d424f5b1f2bf18add00ba8a8 |
--- /dev/null |
+++ b/remoting/host/dev_net_log.cc |
@@ -0,0 +1,62 @@ |
+// Copyright (c) 2012 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. |
+ |
+#include "remoting/host/dev_net_log.h" |
+ |
+#include "base/json/json_writer.h" |
+#include "base/logging.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/time.h" |
+#include "base/threading/thread_restrictions.h" |
+#include "base/values.h" |
+ |
+namespace remoting { |
+ |
+DevNetLog::DevNetLog() : id_(0) { |
+} |
+ |
+DevNetLog::~DevNetLog() { |
+} |
+ |
+void DevNetLog::AddEntry( |
+ EventType type, |
+ const Source& source, |
+ EventPhase phase, |
+ const scoped_refptr<EventParameters>& params) { |
+ |
Sergey Ulanov
2012/04/13 00:55:33
Don't need this empty line.
alexeypa (please no reviews)
2012/04/13 18:28:22
Done.
|
+ scoped_ptr<Value> value( |
+ net::NetLog::EntryToDictionaryValue( |
+ type, base::TimeTicks::Now(), source, phase, params, false)); |
+ // Don't pretty print, so each JSON value occupies a single line, with no |
+ // breaks (Line breaks in any text field will be escaped). Using strings |
+ // instead of integer identifiers allows logs from older versions to be |
+ // loaded, though a little extra parsing has to be done when loading a log. |
+ std::string json; |
+ base::JSONWriter::Write(value.get(), &json); |
+ VLOG(3) << json; |
+} |
+ |
+uint32 DevNetLog::NextID() { |
+ return id_++; |
+} |
+ |
+net::NetLog::LogLevel DevNetLog::GetLogLevel() const { |
+ return LOG_ALL_BUT_BYTES; |
+} |
+ |
+void DevNetLog::AddThreadSafeObserver(ThreadSafeObserver* observer, |
+ net::NetLog::LogLevel log_level) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void DevNetLog::SetObserverLogLevel(ThreadSafeObserver* observer, |
+ net::NetLog::LogLevel log_level) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void DevNetLog::RemoveThreadSafeObserver(ThreadSafeObserver* observer) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+} // namespace remoting |