OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ | 5 #ifndef RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ |
6 #define RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ | 6 #define RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ |
7 | 7 |
8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) | 8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) |
9 #error Do not include eventhandler_fuchsia.h directly; use eventhandler.h instea
d. | 9 #error Do not include eventhandler_fuchsia.h directly; use eventhandler.h instea
d. |
10 #endif | 10 #endif |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Information needed to call mx_handle_wait_many(), and to handle events. | 57 // Information needed to call mx_handle_wait_many(), and to handle events. |
58 class MagentaWaitManyInfo { | 58 class MagentaWaitManyInfo { |
59 public: | 59 public: |
60 MagentaWaitManyInfo(); | 60 MagentaWaitManyInfo(); |
61 ~MagentaWaitManyInfo(); | 61 ~MagentaWaitManyInfo(); |
62 | 62 |
63 intptr_t capacity() const { return capacity_; } | 63 intptr_t capacity() const { return capacity_; } |
64 intptr_t size() const { return size_; } | 64 intptr_t size() const { return size_; } |
65 DescriptorInfo** descriptor_infos() const { return descriptor_infos_; } | 65 DescriptorInfo** descriptor_infos() const { return descriptor_infos_; } |
66 mx_handle_t* handles() const { return handles_; } | |
67 mx_wait_item_t* items() const { return items_; } | 66 mx_wait_item_t* items() const { return items_; } |
68 | 67 |
69 void AddHandle(mx_handle_t handle, mx_signals_t signals, DescriptorInfo* di); | 68 void AddHandle(mx_handle_t handle, mx_signals_t signals, DescriptorInfo* di); |
70 void RemoveHandle(mx_handle_t handle); | 69 void RemoveHandle(mx_handle_t handle); |
71 | 70 |
72 private: | 71 private: |
73 static const intptr_t kInitialCapacity = 32; | 72 static const intptr_t kInitialCapacity = 32; |
74 | 73 |
75 void GrowArraysIfNeeded(intptr_t desired_size); | 74 void GrowArraysIfNeeded(intptr_t desired_size); |
76 | 75 |
77 intptr_t capacity_; | 76 intptr_t capacity_; |
78 intptr_t size_; | 77 intptr_t size_; |
79 DescriptorInfo** descriptor_infos_; | 78 DescriptorInfo** descriptor_infos_; |
80 mx_handle_t* handles_; | |
81 mx_wait_item_t* items_; | 79 mx_wait_item_t* items_; |
82 | 80 |
83 DISALLOW_COPY_AND_ASSIGN(MagentaWaitManyInfo); | 81 DISALLOW_COPY_AND_ASSIGN(MagentaWaitManyInfo); |
84 }; | 82 }; |
85 | 83 |
86 class EventHandlerImplementation { | 84 class EventHandlerImplementation { |
87 public: | 85 public: |
88 EventHandlerImplementation(); | 86 EventHandlerImplementation(); |
89 ~EventHandlerImplementation(); | 87 ~EventHandlerImplementation(); |
90 | 88 |
(...skipping 17 matching lines...) Expand all Loading... |
108 | 106 |
109 MagentaWaitManyInfo info_; | 107 MagentaWaitManyInfo info_; |
110 | 108 |
111 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); | 109 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
112 }; | 110 }; |
113 | 111 |
114 } // namespace bin | 112 } // namespace bin |
115 } // namespace dart | 113 } // namespace dart |
116 | 114 |
117 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ | 115 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ |
OLD | NEW |