OLD | NEW |
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/signaling/server_log_entry.h" | 5 #include "remoting/signaling/server_log_entry.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 10 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 void ServerLogEntry::Set(const std::string& key, const std::string& value) { | 41 void ServerLogEntry::Set(const std::string& key, const std::string& value) { |
42 values_map_[key] = value; | 42 values_map_[key] = value; |
43 } | 43 } |
44 | 44 |
45 void ServerLogEntry::AddCpuField() { | 45 void ServerLogEntry::AddCpuField() { |
46 Set(kKeyCpu, SysInfo::OperatingSystemArchitecture()); | 46 Set(kKeyCpu, SysInfo::OperatingSystemArchitecture()); |
47 } | 47 } |
48 | 48 |
49 void ServerLogEntry::AddModeField(ServerLogEntry::Mode mode) { | 49 void ServerLogEntry::AddModeField(ServerLogEntry::Mode mode) { |
50 const char* mode_value = NULL; | 50 const char* mode_value = nullptr; |
51 switch (mode) { | 51 switch (mode) { |
52 case IT2ME: | 52 case IT2ME: |
53 mode_value = kValueModeIt2Me; | 53 mode_value = kValueModeIt2Me; |
54 break; | 54 break; |
55 case ME2ME: | 55 case ME2ME: |
56 mode_value = kValueModeMe2Me; | 56 mode_value = kValueModeMe2Me; |
57 break; | 57 break; |
58 default: | 58 default: |
59 NOTREACHED(); | 59 NOTREACHED(); |
60 } | 60 } |
(...skipping 18 matching lines...) Expand all Loading... |
79 scoped_ptr<XmlElement> stanza(new XmlElement(QName( | 79 scoped_ptr<XmlElement> stanza(new XmlElement(QName( |
80 kChromotingXmlNamespace, kLogEntry))); | 80 kChromotingXmlNamespace, kLogEntry))); |
81 ValuesMap::const_iterator iter; | 81 ValuesMap::const_iterator iter; |
82 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { | 82 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { |
83 stanza->AddAttr(QName(std::string(), iter->first), iter->second); | 83 stanza->AddAttr(QName(std::string(), iter->first), iter->second); |
84 } | 84 } |
85 return stanza.Pass(); | 85 return stanza.Pass(); |
86 } | 86 } |
87 | 87 |
88 } // namespace remoting | 88 } // namespace remoting |
OLD | NEW |