OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |