Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_; } | 66 mx_handle_t* handles() const { return handles_; } |
| 67 mx_signals_t* signals() const { return signals_; } | 67 mx_wait_item_t* items() const { return items_; } |
| 68 mx_signals_state_t* signals_states() const { return signals_states_; } | |
| 69 | 68 |
| 70 void AddHandle(mx_handle_t handle, mx_signals_t signals, DescriptorInfo* di); | 69 void AddHandle(mx_handle_t handle, mx_signals_t signals, DescriptorInfo* di); |
| 71 void RemoveHandle(mx_handle_t handle); | 70 void RemoveHandle(mx_handle_t handle); |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 static const intptr_t kInitialCapacity = 32; | 73 static const intptr_t kInitialCapacity = 32; |
| 75 | 74 |
| 76 void GrowArraysIfNeeded(intptr_t desired_size); | 75 void GrowArraysIfNeeded(intptr_t desired_size); |
| 77 | 76 |
| 78 intptr_t capacity_; | 77 intptr_t capacity_; |
| 79 intptr_t size_; | 78 intptr_t size_; |
| 80 DescriptorInfo** descriptor_infos_; | 79 DescriptorInfo** descriptor_infos_; |
| 81 mx_handle_t* handles_; | 80 mx_handle_t* handles_; |
|
zra
2016/11/03 05:48:21
It looks like you can also remove handles_
jeffbrown
2016/11/03 05:56:07
whoops!
| |
| 82 mx_signals_t* signals_; | 81 mx_wait_item_t* items_; |
| 83 mx_signals_state_t* signals_states_; | |
| 84 | 82 |
| 85 DISALLOW_COPY_AND_ASSIGN(MagentaWaitManyInfo); | 83 DISALLOW_COPY_AND_ASSIGN(MagentaWaitManyInfo); |
| 86 }; | 84 }; |
| 87 | 85 |
| 88 class EventHandlerImplementation { | 86 class EventHandlerImplementation { |
| 89 public: | 87 public: |
| 90 EventHandlerImplementation(); | 88 EventHandlerImplementation(); |
| 91 ~EventHandlerImplementation(); | 89 ~EventHandlerImplementation(); |
| 92 | 90 |
| 93 void SendData(intptr_t id, Dart_Port dart_port, int64_t data); | 91 void SendData(intptr_t id, Dart_Port dart_port, int64_t data); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 110 | 108 |
| 111 MagentaWaitManyInfo info_; | 109 MagentaWaitManyInfo info_; |
| 112 | 110 |
| 113 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); | 111 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
| 114 }; | 112 }; |
| 115 | 113 |
| 116 } // namespace bin | 114 } // namespace bin |
| 117 } // namespace dart | 115 } // namespace dart |
| 118 | 116 |
| 119 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ | 117 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ |
| OLD | NEW |