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

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

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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/base/vlog_net_log.h ('k') | remoting/client/audio_decode_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/base/vlog_net_log.h" 5 #include "remoting/base/vlog_net_log.h"
6 6
7 #include <memory>
8
7 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "base/values.h" 14 #include "base/values.h"
14 15
15 namespace remoting { 16 namespace remoting {
16 17
17 class VlogNetLog::Observer : public net::NetLog::ThreadSafeObserver { 18 class VlogNetLog::Observer : public net::NetLog::ThreadSafeObserver {
18 public: 19 public:
19 Observer(); 20 Observer();
20 ~Observer() override; 21 ~Observer() override;
21 22
22 // NetLog::ThreadSafeObserver overrides: 23 // NetLog::ThreadSafeObserver overrides:
23 void OnAddEntry(const net::NetLog::Entry& entry) override; 24 void OnAddEntry(const net::NetLog::Entry& entry) override;
24 25
25 private: 26 private:
26 DISALLOW_COPY_AND_ASSIGN(Observer); 27 DISALLOW_COPY_AND_ASSIGN(Observer);
27 }; 28 };
28 29
29 VlogNetLog::Observer::Observer() { 30 VlogNetLog::Observer::Observer() {
30 } 31 }
31 32
32 VlogNetLog::Observer::~Observer() { 33 VlogNetLog::Observer::~Observer() {
33 } 34 }
34 35
35 void VlogNetLog::Observer::OnAddEntry(const net::NetLog::Entry& entry) { 36 void VlogNetLog::Observer::OnAddEntry(const net::NetLog::Entry& entry) {
36 if (VLOG_IS_ON(4)) { 37 if (VLOG_IS_ON(4)) {
37 scoped_ptr<base::Value> value(entry.ToValue()); 38 std::unique_ptr<base::Value> value(entry.ToValue());
38 std::string json; 39 std::string json;
39 base::JSONWriter::Write(*value, &json); 40 base::JSONWriter::Write(*value, &json);
40 VLOG(4) << json; 41 VLOG(4) << json;
41 } 42 }
42 } 43 }
43 44
44 VlogNetLog::VlogNetLog() 45 VlogNetLog::VlogNetLog()
45 : observer_(new Observer()) { 46 : observer_(new Observer()) {
46 DeprecatedAddObserver(observer_.get(), 47 DeprecatedAddObserver(observer_.get(),
47 net::NetLogCaptureMode::IncludeCookiesAndCredentials()); 48 net::NetLogCaptureMode::IncludeCookiesAndCredentials());
48 } 49 }
49 50
50 VlogNetLog::~VlogNetLog() { 51 VlogNetLog::~VlogNetLog() {
51 DeprecatedRemoveObserver(observer_.get()); 52 DeprecatedRemoveObserver(observer_.get());
52 } 53 }
53 54
54 } // namespace remoting 55 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/vlog_net_log.h ('k') | remoting/client/audio_decode_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698