OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef BIN_EVENTHANDLER_LINUX_H_ | 5 #ifndef BIN_EVENTHANDLER_LINUX_H_ |
6 #define BIN_EVENTHANDLER_LINUX_H_ | 6 #define BIN_EVENTHANDLER_LINUX_H_ |
7 | 7 |
8 #if !defined(BIN_EVENTHANDLER_H_) | 8 #if !defined(BIN_EVENTHANDLER_H_) |
9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. |
10 #endif | 10 #endif |
(...skipping 15 matching lines...) Expand all Loading... |
26 explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) { } | 26 explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) { } |
27 | 27 |
28 virtual ~DescriptorInfo() { } | 28 virtual ~DescriptorInfo() { } |
29 | 29 |
30 intptr_t GetPollEvents(); | 30 intptr_t GetPollEvents(); |
31 | 31 |
32 virtual void Close() { | 32 virtual void Close() { |
33 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 33 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
34 fd_ = -1; | 34 fd_ = -1; |
35 } | 35 } |
| 36 |
| 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(DescriptorInfo); |
36 }; | 39 }; |
37 | 40 |
38 | 41 |
39 class DescriptorInfoSingle | 42 class DescriptorInfoSingle |
40 : public DescriptorInfoSingleMixin<DescriptorInfo> { | 43 : public DescriptorInfoSingleMixin<DescriptorInfo> { |
41 public: | 44 public: |
42 explicit DescriptorInfoSingle(intptr_t fd) | 45 explicit DescriptorInfoSingle(intptr_t fd) |
43 : DescriptorInfoSingleMixin(fd, false) {} | 46 : DescriptorInfoSingleMixin(fd, false) {} |
44 virtual ~DescriptorInfoSingle() {} | 47 virtual ~DescriptorInfoSingle() {} |
| 48 |
| 49 private: |
| 50 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoSingle); |
45 }; | 51 }; |
46 | 52 |
47 | 53 |
48 class DescriptorInfoMultiple | 54 class DescriptorInfoMultiple |
49 : public DescriptorInfoMultipleMixin<DescriptorInfo> { | 55 : public DescriptorInfoMultipleMixin<DescriptorInfo> { |
50 public: | 56 public: |
51 explicit DescriptorInfoMultiple(intptr_t fd) | 57 explicit DescriptorInfoMultiple(intptr_t fd) |
52 : DescriptorInfoMultipleMixin(fd, false) {} | 58 : DescriptorInfoMultipleMixin(fd, false) {} |
53 virtual ~DescriptorInfoMultiple() {} | 59 virtual ~DescriptorInfoMultiple() {} |
| 60 |
| 61 private: |
| 62 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoMultiple); |
54 }; | 63 }; |
55 | 64 |
56 | 65 |
57 class EventHandlerImplementation { | 66 class EventHandlerImplementation { |
58 public: | 67 public: |
59 EventHandlerImplementation(); | 68 EventHandlerImplementation(); |
60 ~EventHandlerImplementation(); | 69 ~EventHandlerImplementation(); |
61 | 70 |
62 void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo *di); | 71 void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo *di); |
63 | 72 |
(...skipping 13 matching lines...) Expand all Loading... |
77 intptr_t GetPollEvents(intptr_t events, DescriptorInfo* di); | 86 intptr_t GetPollEvents(intptr_t events, DescriptorInfo* di); |
78 static void* GetHashmapKeyFromFd(intptr_t fd); | 87 static void* GetHashmapKeyFromFd(intptr_t fd); |
79 static uint32_t GetHashmapHashFromFd(intptr_t fd); | 88 static uint32_t GetHashmapHashFromFd(intptr_t fd); |
80 | 89 |
81 HashMap socket_map_; | 90 HashMap socket_map_; |
82 TimeoutQueue timeout_queue_; | 91 TimeoutQueue timeout_queue_; |
83 bool shutdown_; | 92 bool shutdown_; |
84 int interrupt_fds_[2]; | 93 int interrupt_fds_[2]; |
85 int epoll_fd_; | 94 int epoll_fd_; |
86 int timer_fd_; | 95 int timer_fd_; |
| 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
87 }; | 98 }; |
88 | 99 |
89 } // namespace bin | 100 } // namespace bin |
90 } // namespace dart | 101 } // namespace dart |
91 | 102 |
92 #endif // BIN_EVENTHANDLER_LINUX_H_ | 103 #endif // BIN_EVENTHANDLER_LINUX_H_ |
OLD | NEW |