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

Side by Side Diff: net/socket/unix_domain_client_socket_posix.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 "net/socket/unix_domain_client_socket_posix.h" 5 #include "net/socket/unix_domain_client_socket_posix.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 #include <sys/un.h> 8 #include <sys/un.h>
9 #include <utility>
9 10
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/posix/eintr_wrapper.h" 12 #include "base/posix/eintr_wrapper.h"
12 #include "net/base/ip_endpoint.h" 13 #include "net/base/ip_endpoint.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/base/net_util.h" 15 #include "net/base/net_util.h"
15 #include "net/socket/socket_posix.h" 16 #include "net/socket/socket_posix.h"
16 17
17 namespace net { 18 namespace net {
18 19
19 UnixDomainClientSocket::UnixDomainClientSocket(const std::string& socket_path, 20 UnixDomainClientSocket::UnixDomainClientSocket(const std::string& socket_path,
20 bool use_abstract_namespace) 21 bool use_abstract_namespace)
21 : socket_path_(socket_path), 22 : socket_path_(socket_path),
22 use_abstract_namespace_(use_abstract_namespace) { 23 use_abstract_namespace_(use_abstract_namespace) {
23 } 24 }
24 25
25 UnixDomainClientSocket::UnixDomainClientSocket(scoped_ptr<SocketPosix> socket) 26 UnixDomainClientSocket::UnixDomainClientSocket(scoped_ptr<SocketPosix> socket)
26 : use_abstract_namespace_(false), socket_(socket.Pass()) {} 27 : use_abstract_namespace_(false), socket_(std::move(socket)) {}
27 28
28 UnixDomainClientSocket::~UnixDomainClientSocket() { 29 UnixDomainClientSocket::~UnixDomainClientSocket() {
29 Disconnect(); 30 Disconnect();
30 } 31 }
31 32
32 // static 33 // static
33 bool UnixDomainClientSocket::FillAddress(const std::string& socket_path, 34 bool UnixDomainClientSocket::FillAddress(const std::string& socket_path,
34 bool use_abstract_namespace, 35 bool use_abstract_namespace,
35 SockaddrStorage* address) { 36 SockaddrStorage* address) {
36 struct sockaddr_un* socket_addr = 37 struct sockaddr_un* socket_addr =
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 SocketDescriptor UnixDomainClientSocket::ReleaseConnectedSocket() { 183 SocketDescriptor UnixDomainClientSocket::ReleaseConnectedSocket() {
183 DCHECK(socket_); 184 DCHECK(socket_);
184 DCHECK(socket_->IsConnected()); 185 DCHECK(socket_->IsConnected());
185 186
186 SocketDescriptor socket_fd = socket_->ReleaseConnectedSocket(); 187 SocketDescriptor socket_fd = socket_->ReleaseConnectedSocket();
187 socket_.reset(); 188 socket_.reset();
188 return socket_fd; 189 return socket_fd;
189 } 190 }
190 191
191 } // namespace net 192 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/transport_client_socket_pool_test_util.cc ('k') | net/socket/unix_domain_client_socket_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698