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

Side by Side Diff: remoting/host/server_log_entry.cc

Issue 9720019: Use scoped_ptr<> to pass ownership in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/server_log_entry.h ('k') | remoting/host/server_log_entry_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 (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/sys_info.h" 7 #include "base/sys_info.h"
8 #include "remoting/base/constants.h" 8 #include "remoting/base/constants.h"
9 #include "remoting/protocol/session.h" 9 #include "remoting/protocol/session.h"
10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 case IT2ME: 95 case IT2ME:
96 return kValueModeIt2Me; 96 return kValueModeIt2Me;
97 case ME2ME: 97 case ME2ME:
98 return kValueModeMe2Me; 98 return kValueModeMe2Me;
99 default: 99 default:
100 NOTREACHED(); 100 NOTREACHED();
101 return NULL; 101 return NULL;
102 } 102 }
103 } 103 }
104 104
105 XmlElement* ServerLogEntry::ToStanza() const { 105 scoped_ptr<XmlElement> ServerLogEntry::ToStanza() const {
106 XmlElement* stanza = new XmlElement(QName( 106 scoped_ptr<XmlElement> stanza(new XmlElement(QName(
107 kChromotingXmlNamespace, kLogEntry)); 107 kChromotingXmlNamespace, kLogEntry)));
108 ValuesMap::const_iterator iter; 108 ValuesMap::const_iterator iter;
109 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { 109 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) {
110 stanza->AddAttr(QName("", iter->first), iter->second); 110 stanza->AddAttr(QName("", iter->first), iter->second);
111 } 111 }
112 return stanza; 112 return stanza.Pass();
113 } 113 }
114 114
115 const char* ServerLogEntry::GetValueSessionState(bool connected) { 115 const char* ServerLogEntry::GetValueSessionState(bool connected) {
116 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; 116 return connected ? kValueSessionStateConnected : kValueSessionStateClosed;
117 } 117 }
118 118
119 void ServerLogEntry::Set(const char* key, const char* value) { 119 void ServerLogEntry::Set(const char* key, const char* value) {
120 values_map_[key] = value; 120 values_map_[key] = value;
121 } 121 }
122 122
123 } // namespace remoting 123 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/server_log_entry.h ('k') | remoting/host/server_log_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698