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

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

Issue 93263002: Move some more file utils to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « crypto/nss_util.cc ('k') | printing/backend/cups_helper.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 <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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 EVENT_ACCEPT, 47 EVENT_ACCEPT,
48 EVENT_AUTH_DENIED, 48 EVENT_AUTH_DENIED,
49 EVENT_AUTH_GRANTED, 49 EVENT_AUTH_GRANTED,
50 EVENT_CLOSE, 50 EVENT_CLOSE,
51 EVENT_LISTEN, 51 EVENT_LISTEN,
52 EVENT_READ, 52 EVENT_READ,
53 }; 53 };
54 54
55 string MakeSocketPath(const string& socket_file_name) { 55 string MakeSocketPath(const string& socket_file_name) {
56 base::FilePath temp_dir; 56 base::FilePath temp_dir;
57 file_util::GetTempDir(&temp_dir); 57 base::GetTempDir(&temp_dir);
58 return temp_dir.Append(socket_file_name).value(); 58 return temp_dir.Append(socket_file_name).value();
59 } 59 }
60 60
61 string MakeSocketPath() { 61 string MakeSocketPath() {
62 return MakeSocketPath(kSocketFilename); 62 return MakeSocketPath(kSocketFilename);
63 } 63 }
64 64
65 class EventManager : public base::RefCounted<EventManager> { 65 class EventManager : public base::RefCounted<EventManager> {
66 public: 66 public:
67 EventManager() : condition_(&mutex_) {} 67 EventManager() : condition_(&mutex_) {}
(...skipping 261 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 | « crypto/nss_util.cc ('k') | printing/backend/cups_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698