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

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

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 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
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "mojo/services/network/net_adapters.h" 12 #include "mojo/services/network/net_adapters.h"
13 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 16
17 TCPConnectedSocketImpl::TCPConnectedSocketImpl( 17 TCPConnectedSocketImpl::TCPConnectedSocketImpl(
18 scoped_ptr<net::TCPSocket> socket, 18 scoped_ptr<net::TCPSocket> socket,
19 ScopedDataPipeConsumerHandle send_stream, 19 ScopedDataPipeConsumerHandle send_stream,
20 ScopedDataPipeProducerHandle receive_stream, 20 ScopedDataPipeProducerHandle receive_stream,
21 InterfaceRequest<TCPConnectedSocket> request, 21 InterfaceRequest<TCPConnectedSocket> request,
22 scoped_ptr<mojo::AppRefCount> app_refcount) 22 scoped_ptr<mojo::MessageLoopRef> app_refcount)
23 : socket_(std::move(socket)), 23 : socket_(std::move(socket)),
24 send_stream_(std::move(send_stream)), 24 send_stream_(std::move(send_stream)),
25 receive_stream_(std::move(receive_stream)), 25 receive_stream_(std::move(receive_stream)),
26 binding_(this, std::move(request)), 26 binding_(this, std::move(request)),
27 app_refcount_(std::move(app_refcount)), 27 app_refcount_(std::move(app_refcount)),
28 weak_ptr_factory_(this) { 28 weak_ptr_factory_(this) {
29 // Queue up async communication. 29 // Queue up async communication.
30 binding_.set_connection_error_handler([this]() { OnConnectionError(); }); 30 binding_.set_connection_error_handler([this]() { OnConnectionError(); });
31 ListenForReceivePeerClosed(); 31 ListenForReceivePeerClosed();
32 ListenForSendPeerClosed(); 32 ListenForSendPeerClosed();
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 252
253 void TCPConnectedSocketImpl::DeleteIfNeeded() { 253 void TCPConnectedSocketImpl::DeleteIfNeeded() {
254 bool has_send = pending_send_ || send_stream_.is_valid(); 254 bool has_send = pending_send_ || send_stream_.is_valid();
255 bool has_receive = pending_receive_ || receive_stream_.is_valid(); 255 bool has_receive = pending_receive_ || receive_stream_.is_valid();
256 if (!binding_.is_bound() && !has_send && !has_receive) 256 if (!binding_.is_bound() && !has_send && !has_receive)
257 delete this; 257 delete this;
258 } 258 }
259 259
260 } // namespace mojo 260 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/tcp_connected_socket_impl.h ('k') | mojo/services/network/tcp_server_socket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698