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

Side by Side Diff: remoting/host/vlog_net_log.cc

Issue 18460003: Move url_request_context from remoting/host/ to remoting/base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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 unified diff | Download patch
« no previous file with comments | « remoting/host/vlog_net_log.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/host/vlog_net_log.h"
6
7 #include "base/json/json_writer.h"
8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread_restrictions.h"
11 #include "base/time/time.h"
12 #include "base/values.h"
13
14 namespace remoting {
15
16 class VlogNetLog::Observer : public net::NetLog::ThreadSafeObserver {
17 public:
18 Observer();
19 virtual ~Observer();
20
21 // NetLog::ThreadSafeObserver overrides:
22 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
23
24 private:
25 DISALLOW_COPY_AND_ASSIGN(Observer);
26 };
27
28 VlogNetLog::Observer::Observer() {
29 }
30
31 VlogNetLog::Observer::~Observer() {
32 }
33
34 void VlogNetLog::Observer::OnAddEntry(const net::NetLog::Entry& entry) {
35 if (VLOG_IS_ON(4)) {
36 scoped_ptr<Value> value(entry.ToValue());
37 std::string json;
38 base::JSONWriter::Write(value.get(), &json);
39 VLOG(4) << json;
40 }
41 }
42
43 VlogNetLog::VlogNetLog()
44 : observer_(new Observer()) {
45 AddThreadSafeObserver(observer_.get(), LOG_ALL_BUT_BYTES);
46 }
47
48 VlogNetLog::~VlogNetLog() {
49 RemoveThreadSafeObserver(observer_.get());
50 }
51
52 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/vlog_net_log.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698