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

Side by Side Diff: remoting/host/server_log_entry_host.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/server_log_entry_host.h ('k') | remoting/host/server_log_entry_host_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/server_log_entry_host.h" 5 #include "remoting/host/server_log_entry_host.h"
6 6
7 #include "base/strings/stringize_macros.h" 7 #include "base/strings/stringize_macros.h"
8 #include "remoting/host/host_details.h" 8 #include "remoting/host/host_details.h"
9 #include "remoting/signaling/server_log_entry.h" 9 #include "remoting/signaling/server_log_entry.h"
10 10
(...skipping 15 matching lines...) Expand all
26 const char kKeyHostVersion[] = "host-version"; 26 const char kKeyHostVersion[] = "host-version";
27 27
28 const char kKeyConnectionType[] = "connection-type"; 28 const char kKeyConnectionType[] = "connection-type";
29 29
30 const char* GetValueSessionState(bool connected) { 30 const char* GetValueSessionState(bool connected) {
31 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; 31 return connected ? kValueSessionStateConnected : kValueSessionStateClosed;
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 35
36 scoped_ptr<ServerLogEntry> MakeLogEntryForSessionStateChange( 36 std::unique_ptr<ServerLogEntry> MakeLogEntryForSessionStateChange(
37 bool connected) { 37 bool connected) {
38 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry()); 38 std::unique_ptr<ServerLogEntry> entry(new ServerLogEntry());
39 entry->AddRoleField(kValueRoleHost); 39 entry->AddRoleField(kValueRoleHost);
40 entry->AddEventNameField(kValueEventNameSessionState); 40 entry->AddEventNameField(kValueEventNameSessionState);
41 entry->Set(kKeySessionState, GetValueSessionState(connected)); 41 entry->Set(kKeySessionState, GetValueSessionState(connected));
42 return entry; 42 return entry;
43 } 43 }
44 44
45 scoped_ptr<ServerLogEntry> MakeLogEntryForHeartbeat() { 45 std::unique_ptr<ServerLogEntry> MakeLogEntryForHeartbeat() {
46 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry()); 46 std::unique_ptr<ServerLogEntry> entry(new ServerLogEntry());
47 entry->AddRoleField(kValueRoleHost); 47 entry->AddRoleField(kValueRoleHost);
48 entry->AddEventNameField(kValueEventNameHeartbeat); 48 entry->AddEventNameField(kValueEventNameHeartbeat);
49 return entry; 49 return entry;
50 } 50 }
51 51
52 void AddHostFieldsToLogEntry(ServerLogEntry* entry) { 52 void AddHostFieldsToLogEntry(ServerLogEntry* entry) {
53 // TODO os name, os version, and version will be in the main message body, 53 // TODO os name, os version, and version will be in the main message body,
54 // remove these fields at a later date to remove redundancy. 54 // remove these fields at a later date to remove redundancy.
55 entry->Set(kKeyOsName, GetHostOperatingSystemName()); 55 entry->Set(kKeyOsName, GetHostOperatingSystemName());
56 entry->Set(kKeyOsVersion, GetHostOperatingSystemVersion()); 56 entry->Set(kKeyOsVersion, GetHostOperatingSystemVersion());
57 entry->Set(kKeyHostVersion, STRINGIZE(VERSION)); 57 entry->Set(kKeyHostVersion, STRINGIZE(VERSION));
58 entry->AddCpuField(); 58 entry->AddCpuField();
59 }; 59 };
60 60
61 void AddConnectionTypeToLogEntry(ServerLogEntry* entry, 61 void AddConnectionTypeToLogEntry(ServerLogEntry* entry,
62 protocol::TransportRoute::RouteType type) { 62 protocol::TransportRoute::RouteType type) {
63 entry->Set(kKeyConnectionType, protocol::TransportRoute::GetTypeString(type)); 63 entry->Set(kKeyConnectionType, protocol::TransportRoute::GetTypeString(type));
64 } 64 }
65 65
66 } // namespace remoting 66 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/server_log_entry_host.h ('k') | remoting/host/server_log_entry_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698