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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/transport_client_socket_unittest.cc ('k') | net/socket_stream/socket_stream.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_socket_posix.h" 5 #include "net/socket/unix_domain_socket_posix.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 #include <string> 8 #include <string>
9 9
10 #include <errno.h> 10 #include <errno.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (!GetPeerIds(conn, &user_id, &group_id) || 144 if (!GetPeerIds(conn, &user_id, &group_id) ||
145 !auth_callback_.Run(user_id, group_id)) { 145 !auth_callback_.Run(user_id, group_id)) {
146 if (HANDLE_EINTR(close(conn)) < 0) 146 if (HANDLE_EINTR(close(conn)) < 0)
147 LOG(ERROR) << "close() error"; 147 LOG(ERROR) << "close() error";
148 return; 148 return;
149 } 149 }
150 scoped_refptr<UnixDomainSocket> sock( 150 scoped_refptr<UnixDomainSocket> sock(
151 new UnixDomainSocket(conn, socket_delegate_, auth_callback_)); 151 new UnixDomainSocket(conn, socket_delegate_, auth_callback_));
152 // It's up to the delegate to AddRef if it wants to keep it around. 152 // It's up to the delegate to AddRef if it wants to keep it around.
153 sock->WatchSocket(WAITING_READ); 153 sock->WatchSocket(WAITING_READ);
154 socket_delegate_->DidAccept(this, sock); 154 socket_delegate_->DidAccept(this, sock.get());
155 } 155 }
156 156
157 UnixDomainSocketFactory::UnixDomainSocketFactory( 157 UnixDomainSocketFactory::UnixDomainSocketFactory(
158 const std::string& path, 158 const std::string& path,
159 const UnixDomainSocket::AuthCallback& auth_callback) 159 const UnixDomainSocket::AuthCallback& auth_callback)
160 : path_(path), 160 : path_(path),
161 auth_callback_(auth_callback) {} 161 auth_callback_(auth_callback) {}
162 162
163 UnixDomainSocketFactory::~UnixDomainSocketFactory() {} 163 UnixDomainSocketFactory::~UnixDomainSocketFactory() {}
164 164
(...skipping 19 matching lines...) Expand all
184 scoped_refptr<StreamListenSocket> 184 scoped_refptr<StreamListenSocket>
185 UnixDomainSocketWithAbstractNamespaceFactory::CreateAndListen( 185 UnixDomainSocketWithAbstractNamespaceFactory::CreateAndListen(
186 StreamListenSocket::Delegate* delegate) const { 186 StreamListenSocket::Delegate* delegate) const {
187 return UnixDomainSocket::CreateAndListenWithAbstractNamespace( 187 return UnixDomainSocket::CreateAndListenWithAbstractNamespace(
188 path_, fallback_path_, delegate, auth_callback_); 188 path_, fallback_path_, delegate, auth_callback_);
189 } 189 }
190 190
191 #endif 191 #endif
192 192
193 } // namespace net 193 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/transport_client_socket_unittest.cc ('k') | net/socket_stream/socket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698