blob: 05e9a3513b14c65f8e38da89e82964b50b0346a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// 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/vlog_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 {
VlogNetLog::VlogNetLog() : id_(0) {
}
VlogNetLog::~VlogNetLog() {
}
void VlogNetLog::OnAddEntry(const NetLog::Entry& entry) {
if (VLOG_IS_ON(4)) {
scoped_ptr<Value> value(entry.ToValue());
std::string json;
base::JSONWriter::Write(value.get(), &json);
VLOG(4) << json;
}
}
uint32 VlogNetLog::NextID() {
// TODO(mmenke): Make this threadsafe and start with 1 instead of 0.
return id_++;
}
net::NetLog::LogLevel VlogNetLog::GetLogLevel() const {
return LOG_ALL_BUT_BYTES;
}
void VlogNetLog::AddThreadSafeObserver(ThreadSafeObserver* observer,
net::NetLog::LogLevel log_level) {
NOTIMPLEMENTED();
}
void VlogNetLog::SetObserverLogLevel(ThreadSafeObserver* observer,
net::NetLog::LogLevel log_level) {
NOTIMPLEMENTED();
}
void VlogNetLog::RemoveThreadSafeObserver(ThreadSafeObserver* observer) {
NOTIMPLEMENTED();
}
} // namespace remoting
|