OLD | NEW |
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/server_log_entry.h" | 5 #include "remoting/host/server_log_entry.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stringize_macros.h" | 8 #include "base/stringize_macros.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 int32 os_minor_version = 0; | 103 int32 os_minor_version = 0; |
104 int32 os_bugfix_version = 0; | 104 int32 os_bugfix_version = 0; |
105 SysInfo::OperatingSystemVersionNumbers(&os_major_version, &os_minor_version, | 105 SysInfo::OperatingSystemVersionNumbers(&os_major_version, &os_minor_version, |
106 &os_bugfix_version); | 106 &os_bugfix_version); |
107 os_version << os_major_version << "." << os_minor_version << "." | 107 os_version << os_major_version << "." << os_minor_version << "." |
108 << os_bugfix_version; | 108 << os_bugfix_version; |
109 Set(kKeyOsVersion, os_version.str()); | 109 Set(kKeyOsVersion, os_version.str()); |
110 #endif | 110 #endif |
111 | 111 |
112 Set(kKeyHostVersion, STRINGIZE(VERSION)); | 112 Set(kKeyHostVersion, STRINGIZE(VERSION)); |
113 Set(kKeyCpu, SysInfo::CPUArchitecture()); | 113 Set(kKeyCpu, SysInfo::OperatingSystemArchitecture()); |
114 }; | 114 }; |
115 | 115 |
116 void ServerLogEntry::AddModeField(ServerLogEntry::Mode mode) { | 116 void ServerLogEntry::AddModeField(ServerLogEntry::Mode mode) { |
117 Set(kKeyMode, GetValueMode(mode)); | 117 Set(kKeyMode, GetValueMode(mode)); |
118 } | 118 } |
119 | 119 |
120 void ServerLogEntry::AddConnectionTypeField( | 120 void ServerLogEntry::AddConnectionTypeField( |
121 protocol::TransportRoute::RouteType type) { | 121 protocol::TransportRoute::RouteType type) { |
122 Set(kKeyConnectionType, protocol::TransportRoute::GetTypeString(type)); | 122 Set(kKeyConnectionType, protocol::TransportRoute::GetTypeString(type)); |
123 } | 123 } |
124 | 124 |
125 // static | 125 // static |
126 const char* ServerLogEntry::GetValueMode(ServerLogEntry::Mode mode) { | 126 const char* ServerLogEntry::GetValueMode(ServerLogEntry::Mode mode) { |
127 switch(mode) { | 127 switch (mode) { |
128 case IT2ME: | 128 case IT2ME: |
129 return kValueModeIt2Me; | 129 return kValueModeIt2Me; |
130 case ME2ME: | 130 case ME2ME: |
131 return kValueModeMe2Me; | 131 return kValueModeMe2Me; |
132 default: | 132 default: |
133 NOTREACHED(); | 133 NOTREACHED(); |
134 return NULL; | 134 return NULL; |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
(...skipping 10 matching lines...) Expand all Loading... |
148 // static | 148 // static |
149 const char* ServerLogEntry::GetValueSessionState(bool connected) { | 149 const char* ServerLogEntry::GetValueSessionState(bool connected) { |
150 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; | 150 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; |
151 } | 151 } |
152 | 152 |
153 void ServerLogEntry::Set(const std::string& key, const std::string& value) { | 153 void ServerLogEntry::Set(const std::string& key, const std::string& value) { |
154 values_map_[key] = value; | 154 values_map_[key] = value; |
155 } | 155 } |
156 | 156 |
157 } // namespace remoting | 157 } // namespace remoting |
OLD | NEW |