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

Side by Side Diff: remoting/signaling/log_to_server.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
« no previous file with comments | « remoting/signaling/log_to_server.h ('k') | remoting/signaling/log_to_server_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 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/log_to_server.h" 5 #include "remoting/signaling/log_to_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "remoting/base/constants.h" 9 #include "remoting/base/constants.h"
10 #include "remoting/signaling/iq_sender.h" 10 #include "remoting/signaling/iq_sender.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 void LogToServer::SendPendingEntries() { 54 void LogToServer::SendPendingEntries() {
55 if (iq_sender_ == nullptr) { 55 if (iq_sender_ == nullptr) {
56 return; 56 return;
57 } 57 }
58 if (pending_entries_.empty()) { 58 if (pending_entries_.empty()) {
59 return; 59 return;
60 } 60 }
61 // Make one stanza containing all the pending entries. 61 // Make one stanza containing all the pending entries.
62 scoped_ptr<XmlElement> stanza(ServerLogEntry::MakeStanza()); 62 std::unique_ptr<XmlElement> stanza(ServerLogEntry::MakeStanza());
63 while (!pending_entries_.empty()) { 63 while (!pending_entries_.empty()) {
64 ServerLogEntry& entry = pending_entries_.front(); 64 ServerLogEntry& entry = pending_entries_.front();
65 stanza->AddElement(entry.ToStanza().release()); 65 stanza->AddElement(entry.ToStanza().release());
66 pending_entries_.pop_front(); 66 pending_entries_.pop_front();
67 } 67 }
68 // Send the stanza to the server and ignore the response. 68 // Send the stanza to the server and ignore the response.
69 iq_sender_->SendIq(buzz::STR_SET, directory_bot_jid_, std::move(stanza), 69 iq_sender_->SendIq(buzz::STR_SET, directory_bot_jid_, std::move(stanza),
70 IqSender::ReplyCallback()); 70 IqSender::ReplyCallback());
71 } 71 }
72 72
73 } // namespace remoting 73 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/signaling/log_to_server.h ('k') | remoting/signaling/log_to_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698