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

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

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: Created 5 years 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
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/host/gnubby_auth_handler_posix.h" 5 #include "remoting/host/gnubby_auth_handler_posix.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 DCHECK(CalledOnValidThread()); 202 DCHECK(CalledOnValidThread());
203 DCHECK_NE(net::ERR_IO_PENDING, result); 203 DCHECK_NE(net::ERR_IO_PENDING, result);
204 204
205 if (result < 0) { 205 if (result < 0) {
206 LOG(ERROR) << "Error in accepting a new connection"; 206 LOG(ERROR) << "Error in accepting a new connection";
207 return; 207 return;
208 } 208 }
209 209
210 int connection_id = ++last_connection_id_; 210 int connection_id = ++last_connection_id_;
211 GnubbySocket* socket = 211 GnubbySocket* socket =
212 new GnubbySocket(accept_socket_.Pass(), request_timeout_, 212 new GnubbySocket(std::move(accept_socket_), request_timeout_,
213 base::Bind(&GnubbyAuthHandlerPosix::RequestTimedOut, 213 base::Bind(&GnubbyAuthHandlerPosix::RequestTimedOut,
214 base::Unretained(this), connection_id)); 214 base::Unretained(this), connection_id));
215 active_sockets_[connection_id] = socket; 215 active_sockets_[connection_id] = socket;
216 socket->StartReadingRequest( 216 socket->StartReadingRequest(
217 base::Bind(&GnubbyAuthHandlerPosix::OnReadComplete, 217 base::Bind(&GnubbyAuthHandlerPosix::OnReadComplete,
218 base::Unretained(this), connection_id)); 218 base::Unretained(this), connection_id));
219 219
220 // Continue accepting new connections. 220 // Continue accepting new connections.
221 DoAccept(); 221 DoAccept();
222 } 222 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) { 294 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) {
295 HOST_LOG << "Gnubby request timed out"; 295 HOST_LOG << "Gnubby request timed out";
296 ActiveSockets::iterator iter = active_sockets_.find(connection_id); 296 ActiveSockets::iterator iter = active_sockets_.find(connection_id);
297 if (iter != active_sockets_.end()) 297 if (iter != active_sockets_.end())
298 SendErrorAndCloseActiveSocket(iter); 298 SendErrorAndCloseActiveSocket(iter);
299 } 299 }
300 300
301 } // namespace remoting 301 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698