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

Side by Side Diff: remoting/host/host_event_logger_posix.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/host/host_event_logger.h ('k') | remoting/host/host_event_logger_win.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 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 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/host/host_event_logger.h" 5 #include "remoting/host/host_event_logger.h"
6 6
7 // Included here, since the #define for LOG_USER in syslog.h conflicts with the
8 // constants in base/logging.h, and this source file should use the version in
9 // syslog.h.
10 #include <syslog.h>
11
12 #include <memory>
13
7 #include "base/macros.h" 14 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
10 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
11 #include "net/base/ip_endpoint.h" 18 #include "net/base/ip_endpoint.h"
12 #include "remoting/host/host_status_monitor.h" 19 #include "remoting/host/host_status_monitor.h"
13 #include "remoting/host/host_status_observer.h" 20 #include "remoting/host/host_status_observer.h"
14 #include "remoting/protocol/transport.h" 21 #include "remoting/protocol/transport.h"
15 22
16 // Included here, since the #define for LOG_USER in syslog.h conflicts with the
17 // constants in base/logging.h, and this source file should use the version in
18 // syslog.h.
19 #include <syslog.h>
20
21 namespace remoting { 23 namespace remoting {
22 24
23 namespace { 25 namespace {
24 26
25 class HostEventLoggerPosix : public HostEventLogger, public HostStatusObserver { 27 class HostEventLoggerPosix : public HostEventLogger, public HostStatusObserver {
26 public: 28 public:
27 HostEventLoggerPosix(base::WeakPtr<HostStatusMonitor> monitor, 29 HostEventLoggerPosix(base::WeakPtr<HostStatusMonitor> monitor,
28 const std::string& application_name); 30 const std::string& application_name);
29 31
30 ~HostEventLoggerPosix() override; 32 ~HostEventLoggerPosix() override;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 98
97 void HostEventLoggerPosix::OnStart(const std::string& xmpp_login) { 99 void HostEventLoggerPosix::OnStart(const std::string& xmpp_login) {
98 Log("Host started for user: " + xmpp_login); 100 Log("Host started for user: " + xmpp_login);
99 } 101 }
100 102
101 void HostEventLoggerPosix::Log(const std::string& message) { 103 void HostEventLoggerPosix::Log(const std::string& message) {
102 syslog(LOG_USER | LOG_NOTICE, "%s", message.c_str()); 104 syslog(LOG_USER | LOG_NOTICE, "%s", message.c_str());
103 } 105 }
104 106
105 // static 107 // static
106 scoped_ptr<HostEventLogger> HostEventLogger::Create( 108 std::unique_ptr<HostEventLogger> HostEventLogger::Create(
107 base::WeakPtr<HostStatusMonitor> monitor, 109 base::WeakPtr<HostStatusMonitor> monitor,
108 const std::string& application_name) { 110 const std::string& application_name) {
109 return make_scoped_ptr(new HostEventLoggerPosix(monitor, application_name)); 111 return base::WrapUnique(new HostEventLoggerPosix(monitor, application_name));
110 } 112 }
111 113
112 } // namespace remoting 114 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_event_logger.h ('k') | remoting/host/host_event_logger_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698