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

Side by Side Diff: mojo/services/network/tcp_connected_socket_impl.cc

Issue 1539863002: Convert Pass()→std::move() in mojo/services/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing forward declare that was masked by pre-existing incorrect #include ordering. 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 "mojo/services/network/tcp_connected_socket_impl.h" 5 #include "mojo/services/network/tcp_connected_socket_impl.h"
6 6
7 #include <utility>
8
7 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
8 #include "mojo/services/network/net_adapters.h" 10 #include "mojo/services/network/net_adapters.h"
9 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
10 12
11 namespace mojo { 13 namespace mojo {
12 14
13 TCPConnectedSocketImpl::TCPConnectedSocketImpl( 15 TCPConnectedSocketImpl::TCPConnectedSocketImpl(
14 scoped_ptr<net::TCPSocket> socket, 16 scoped_ptr<net::TCPSocket> socket,
15 ScopedDataPipeConsumerHandle send_stream, 17 ScopedDataPipeConsumerHandle send_stream,
16 ScopedDataPipeProducerHandle receive_stream, 18 ScopedDataPipeProducerHandle receive_stream,
17 InterfaceRequest<TCPConnectedSocket> request, 19 InterfaceRequest<TCPConnectedSocket> request,
18 scoped_ptr<mojo::AppRefCount> app_refcount) 20 scoped_ptr<mojo::AppRefCount> app_refcount)
19 : socket_(socket.Pass()), 21 : socket_(std::move(socket)),
20 send_stream_(send_stream.Pass()), 22 send_stream_(std::move(send_stream)),
21 receive_stream_(receive_stream.Pass()), 23 receive_stream_(std::move(receive_stream)),
22 binding_(this, request.Pass()), 24 binding_(this, std::move(request)),
23 app_refcount_(app_refcount.Pass()), 25 app_refcount_(std::move(app_refcount)),
24 weak_ptr_factory_(this) { 26 weak_ptr_factory_(this) {
25 // Queue up async communication. 27 // Queue up async communication.
26 binding_.set_connection_error_handler([this]() { OnConnectionError(); }); 28 binding_.set_connection_error_handler([this]() { OnConnectionError(); });
27 ListenForReceivePeerClosed(); 29 ListenForReceivePeerClosed();
28 ListenForSendPeerClosed(); 30 ListenForSendPeerClosed();
29 ReceiveMore(); 31 ReceiveMore();
30 SendMore(); 32 SendMore();
31 } 33 }
32 34
33 TCPConnectedSocketImpl::~TCPConnectedSocketImpl() { 35 TCPConnectedSocketImpl::~TCPConnectedSocketImpl() {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 249 }
248 250
249 void TCPConnectedSocketImpl::DeleteIfNeeded() { 251 void TCPConnectedSocketImpl::DeleteIfNeeded() {
250 bool has_send = pending_send_ || send_stream_.is_valid(); 252 bool has_send = pending_send_ || send_stream_.is_valid();
251 bool has_receive = pending_receive_ || receive_stream_.is_valid(); 253 bool has_receive = pending_receive_ || receive_stream_.is_valid();
252 if (!binding_.is_bound() && !has_send && !has_receive) 254 if (!binding_.is_bound() && !has_send && !has_receive)
253 delete this; 255 delete this;
254 } 256 }
255 257
256 } // namespace mojo 258 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/tcp_bound_socket_impl.cc ('k') | mojo/services/network/tcp_server_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698