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

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

Issue 10399127: [Chromoting] Replace some bare pointers with scoped_ptrs, and improve naming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ServerLogEntry::~ServerLogEntry() { 56 ServerLogEntry::~ServerLogEntry() {
57 } 57 }
58 58
59 // static 59 // static
60 scoped_ptr<buzz::XmlElement> ServerLogEntry::MakeStanza() { 60 scoped_ptr<buzz::XmlElement> ServerLogEntry::MakeStanza() {
61 return scoped_ptr<buzz::XmlElement>( 61 return scoped_ptr<buzz::XmlElement>(
62 new XmlElement(QName(kChromotingXmlNamespace, kLogCommand))); 62 new XmlElement(QName(kChromotingXmlNamespace, kLogCommand)));
63 } 63 }
64 64
65 // static 65 // static
66 ServerLogEntry* ServerLogEntry::MakeSessionStateChange(bool connected) { 66 scoped_ptr<ServerLogEntry> ServerLogEntry::MakeForSessionStateChange(
67 ServerLogEntry* entry = new ServerLogEntry(); 67 bool connected) {
68 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry());
68 entry->Set(kKeyRole, kValueRoleHost); 69 entry->Set(kKeyRole, kValueRoleHost);
69 entry->Set(kKeyEventName, kValueEventNameSessionState); 70 entry->Set(kKeyEventName, kValueEventNameSessionState);
70 entry->Set(kKeySessionState, GetValueSessionState(connected)); 71 entry->Set(kKeySessionState, GetValueSessionState(connected));
71 return entry; 72 return entry.Pass();
72 } 73 }
73 74
74 // static 75 // static
75 ServerLogEntry* ServerLogEntry::MakeForHeartbeat() { 76 scoped_ptr<ServerLogEntry> ServerLogEntry::MakeForHeartbeat() {
76 ServerLogEntry* entry = new ServerLogEntry(); 77 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry());
77 entry->Set(kKeyRole, kValueRoleHost); 78 entry->Set(kKeyRole, kValueRoleHost);
78 entry->Set(kKeyEventName, kValueEventNameHeartbeat); 79 entry->Set(kKeyEventName, kValueEventNameHeartbeat);
79 return entry; 80 return entry.Pass();
80 } 81 }
81 82
82 void ServerLogEntry::AddHostFields() { 83 void ServerLogEntry::AddHostFields() {
83 #if defined(OS_WIN) 84 #if defined(OS_WIN)
84 Set(kKeyOsName, kValueOsNameWindows); 85 Set(kKeyOsName, kValueOsNameWindows);
85 #elif defined(OS_MACOSX) 86 #elif defined(OS_MACOSX)
86 Set(kKeyOsName, kValueOsNameMac); 87 Set(kKeyOsName, kValueOsNameMac);
87 #elif defined(OS_CHROMEOS) 88 #elif defined(OS_CHROMEOS)
88 Set(kKeyOsName, kValueOsNameChromeOS); 89 Set(kKeyOsName, kValueOsNameChromeOS);
89 #elif defined(OS_LINUX) 90 #elif defined(OS_LINUX)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // static 143 // static
143 const char* ServerLogEntry::GetValueSessionState(bool connected) { 144 const char* ServerLogEntry::GetValueSessionState(bool connected) {
144 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; 145 return connected ? kValueSessionStateConnected : kValueSessionStateClosed;
145 } 146 }
146 147
147 void ServerLogEntry::Set(const std::string& key, const std::string& value) { 148 void ServerLogEntry::Set(const std::string& key, const std::string& value) {
148 values_map_[key] = value; 149 values_map_[key] = value;
149 } 150 }
150 151
151 } // namespace remoting 152 } // 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