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

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

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <poll.h> 7 #include <poll.h>
8 #include <sys/socket.h> 8 #include <sys/socket.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <sys/time.h> 10 #include <sys/time.h>
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 socket_delegate_.reset(); 176 socket_delegate_.reset();
177 event_manager_ = NULL; 177 event_manager_ = NULL;
178 } 178 }
179 179
180 UnixDomainSocket::AuthCallback MakeAuthCallback() { 180 UnixDomainSocket::AuthCallback MakeAuthCallback() {
181 return base::Bind(&UserCanConnectCallback, allow_user_, event_manager_); 181 return base::Bind(&UserCanConnectCallback, allow_user_, event_manager_);
182 } 182 }
183 183
184 void DeleteSocketFile() { 184 void DeleteSocketFile() {
185 ASSERT_FALSE(file_path_.empty()); 185 ASSERT_FALSE(file_path_.empty());
186 file_util::Delete(file_path_, false /* not recursive */); 186 base::Delete(file_path_, false /* not recursive */);
187 } 187 }
188 188
189 SocketDescriptor CreateClientSocket() { 189 SocketDescriptor CreateClientSocket() {
190 const SocketDescriptor sock = socket(PF_UNIX, SOCK_STREAM, 0); 190 const SocketDescriptor sock = socket(PF_UNIX, SOCK_STREAM, 0);
191 if (sock < 0) { 191 if (sock < 0) {
192 LOG(ERROR) << "socket() error"; 192 LOG(ERROR) << "socket() error";
193 return StreamListenSocket::kInvalidSocket; 193 return StreamListenSocket::kInvalidSocket;
194 } 194 }
195 sockaddr_un addr; 195 sockaddr_un addr;
196 memset(&addr, 0, sizeof(addr)); 196 memset(&addr, 0, sizeof(addr));
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 // Send() must fail. 330 // Send() must fail.
331 ssize_t ret = HANDLE_EINTR(send(sock, kMsg, sizeof(kMsg), 0)); 331 ssize_t ret = HANDLE_EINTR(send(sock, kMsg, sizeof(kMsg), 0));
332 ASSERT_EQ(-1, ret); 332 ASSERT_EQ(-1, ret);
333 ASSERT_EQ(EPIPE, errno); 333 ASSERT_EQ(EPIPE, errno);
334 ASSERT_FALSE(event_manager_->HasPendingEvent()); 334 ASSERT_FALSE(event_manager_->HasPendingEvent());
335 } 335 }
336 336
337 } // namespace 337 } // namespace
338 } // namespace net 338 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_linux_unittest.cc ('k') | net/url_request/url_fetcher_response_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698