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/memory/ptr_util.h" |
8 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
9 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
10 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 11 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
11 | 12 |
12 using base::SysInfo; | 13 using base::SysInfo; |
13 using buzz::QName; | 14 using buzz::QName; |
14 using buzz::XmlElement; | 15 using buzz::XmlElement; |
15 | 16 |
16 namespace remoting { | 17 namespace remoting { |
17 | 18 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 66 |
66 void ServerLogEntry::AddRoleField(const char* role) { | 67 void ServerLogEntry::AddRoleField(const char* role) { |
67 Set(kKeyRole, role); | 68 Set(kKeyRole, role); |
68 } | 69 } |
69 | 70 |
70 void ServerLogEntry::AddEventNameField(const char* name) { | 71 void ServerLogEntry::AddEventNameField(const char* name) { |
71 Set(kKeyEventName, name); | 72 Set(kKeyEventName, name); |
72 } | 73 } |
73 | 74 |
74 // static | 75 // static |
75 scoped_ptr<XmlElement> ServerLogEntry::MakeStanza() { | 76 std::unique_ptr<XmlElement> ServerLogEntry::MakeStanza() { |
76 return make_scoped_ptr( | 77 return base::WrapUnique( |
77 new XmlElement(QName(kChromotingXmlNamespace, kLogCommand))); | 78 new XmlElement(QName(kChromotingXmlNamespace, kLogCommand))); |
78 } | 79 } |
79 | 80 |
80 scoped_ptr<XmlElement> ServerLogEntry::ToStanza() const { | 81 std::unique_ptr<XmlElement> ServerLogEntry::ToStanza() const { |
81 scoped_ptr<XmlElement> stanza(new XmlElement(QName( | 82 std::unique_ptr<XmlElement> stanza( |
82 kChromotingXmlNamespace, kLogEntry))); | 83 new XmlElement(QName(kChromotingXmlNamespace, kLogEntry))); |
83 ValuesMap::const_iterator iter; | 84 ValuesMap::const_iterator iter; |
84 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { | 85 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { |
85 stanza->AddAttr(QName(std::string(), iter->first), iter->second); | 86 stanza->AddAttr(QName(std::string(), iter->first), iter->second); |
86 } | 87 } |
87 return stanza; | 88 return stanza; |
88 } | 89 } |
89 | 90 |
90 } // namespace remoting | 91 } // namespace remoting |
OLD | NEW |