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

Side by Side Diff: remoting/host/log_to_server.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
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/log_to_server.h" 5 #include "remoting/host/log_to_server.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "remoting/base/constants.h" 9 #include "remoting/base/constants.h"
10 #include "remoting/host/chromoting_host.h" 10 #include "remoting/host/chromoting_host.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return; 90 return;
91 } 91 }
92 if (pending_entries_.empty()) { 92 if (pending_entries_.empty()) {
93 return; 93 return;
94 } 94 }
95 // Make one stanza containing all the pending entries. 95 // Make one stanza containing all the pending entries.
96 scoped_ptr<XmlElement> stanza(new XmlElement(QName( 96 scoped_ptr<XmlElement> stanza(new XmlElement(QName(
97 kChromotingXmlNamespace, kLogCommand))); 97 kChromotingXmlNamespace, kLogCommand)));
98 while (!pending_entries_.empty()) { 98 while (!pending_entries_.empty()) {
99 ServerLogEntry& entry = pending_entries_.front(); 99 ServerLogEntry& entry = pending_entries_.front();
100 stanza->AddElement(entry.ToStanza()); 100 stanza->AddElement(entry.ToStanza().release());
Alpha Left Google 2012/03/20 18:56:40 This old code seems to cause a crash.
Sergey Ulanov 2012/03/20 19:08:12 Not sure what you mean here. How does it cause a c
101 pending_entries_.pop_front(); 101 pending_entries_.pop_front();
102 } 102 }
103 // Send the stanza to the server. 103 // Send the stanza to the server.
104 scoped_ptr<IqRequest> req = iq_sender_->SendIq( 104 scoped_ptr<IqRequest> req = iq_sender_->SendIq(
105 buzz::STR_SET, kChromotingBotJid, stanza.Pass(), 105 buzz::STR_SET, kChromotingBotJid, stanza.Pass(),
106 IqSender::ReplyCallback()); 106 IqSender::ReplyCallback());
107 // We ignore any response, so let the IqRequest be destroyed. 107 // We ignore any response, so let the IqRequest be destroyed.
108 return; 108 return;
109 } 109 }
110 110
111 } // namespace remoting 111 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698