| 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_MACOS_H_ | 5 #ifndef BIN_EVENTHANDLER_MACOS_H_ |
| 6 #define BIN_EVENTHANDLER_MACOS_H_ | 6 #define BIN_EVENTHANDLER_MACOS_H_ |
| 7 | 7 |
| 8 #if !defined(BIN_EVENTHANDLER_H_) | 8 #if !defined(BIN_EVENTHANDLER_H_) |
| 9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool tracked_by_kqueue() { return tracked_by_kqueue_; } | 42 bool tracked_by_kqueue() { return tracked_by_kqueue_; } |
| 43 | 43 |
| 44 bool HasReadEvent(); | 44 bool HasReadEvent(); |
| 45 | 45 |
| 46 bool HasWriteEvent(); | 46 bool HasWriteEvent(); |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 bool tracked_by_kqueue_; | 49 bool tracked_by_kqueue_; |
| 50 |
| 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(DescriptorInfo); |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 | 55 |
| 53 class DescriptorInfoSingle | 56 class DescriptorInfoSingle |
| 54 : public DescriptorInfoSingleMixin<DescriptorInfo> { | 57 : public DescriptorInfoSingleMixin<DescriptorInfo> { |
| 55 public: | 58 public: |
| 56 explicit DescriptorInfoSingle(intptr_t fd) | 59 explicit DescriptorInfoSingle(intptr_t fd) |
| 57 : DescriptorInfoSingleMixin(fd, false) {} | 60 : DescriptorInfoSingleMixin(fd, false) {} |
| 58 virtual ~DescriptorInfoSingle() {} | 61 virtual ~DescriptorInfoSingle() {} |
| 62 |
| 63 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoSingle); |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 | 67 |
| 62 class DescriptorInfoMultiple | 68 class DescriptorInfoMultiple |
| 63 : public DescriptorInfoMultipleMixin<DescriptorInfo> { | 69 : public DescriptorInfoMultipleMixin<DescriptorInfo> { |
| 64 public: | 70 public: |
| 65 explicit DescriptorInfoMultiple(intptr_t fd) | 71 explicit DescriptorInfoMultiple(intptr_t fd) |
| 66 : DescriptorInfoMultipleMixin(fd, false) {} | 72 : DescriptorInfoMultipleMixin(fd, false) {} |
| 67 virtual ~DescriptorInfoMultiple() {} | 73 virtual ~DescriptorInfoMultiple() {} |
| 74 |
| 75 private: |
| 76 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoMultiple); |
| 68 }; | 77 }; |
| 69 | 78 |
| 70 | 79 |
| 71 class EventHandlerImplementation { | 80 class EventHandlerImplementation { |
| 72 public: | 81 public: |
| 73 EventHandlerImplementation(); | 82 EventHandlerImplementation(); |
| 74 ~EventHandlerImplementation(); | 83 ~EventHandlerImplementation(); |
| 75 | 84 |
| 76 void UpdateKQueueInstance(intptr_t old_mask, DescriptorInfo *di); | 85 void UpdateKQueueInstance(intptr_t old_mask, DescriptorInfo *di); |
| 77 | 86 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); | 101 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); |
| 93 intptr_t GetEvents(struct kevent* event, DescriptorInfo* di); | 102 intptr_t GetEvents(struct kevent* event, DescriptorInfo* di); |
| 94 static void* GetHashmapKeyFromFd(intptr_t fd); | 103 static void* GetHashmapKeyFromFd(intptr_t fd); |
| 95 static uint32_t GetHashmapHashFromFd(intptr_t fd); | 104 static uint32_t GetHashmapHashFromFd(intptr_t fd); |
| 96 | 105 |
| 97 HashMap socket_map_; | 106 HashMap socket_map_; |
| 98 TimeoutQueue timeout_queue_; | 107 TimeoutQueue timeout_queue_; |
| 99 bool shutdown_; | 108 bool shutdown_; |
| 100 int interrupt_fds_[2]; | 109 int interrupt_fds_[2]; |
| 101 int kqueue_fd_; | 110 int kqueue_fd_; |
| 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
| 102 }; | 113 }; |
| 103 | 114 |
| 104 } // namespace bin | 115 } // namespace bin |
| 105 } // namespace dart | 116 } // namespace dart |
| 106 | 117 |
| 107 #endif // BIN_EVENTHANDLER_MACOS_H_ | 118 #endif // BIN_EVENTHANDLER_MACOS_H_ |
| OLD | NEW |