| 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. |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include <errno.h> | 12 #include <errno.h> |
| 13 #include <magenta/syscalls.h> | 13 #include <magenta/syscalls.h> |
| 14 | 14 |
| 15 #include "platform/signal_blocker.h" | 15 #include "platform/signal_blocker.h" |
| 16 | 16 |
| 17 namespace dart { | 17 namespace dart { |
| 18 namespace bin { | 18 namespace bin { |
| 19 | 19 |
| 20 class DescriptorInfo : public DescriptorInfoBase { | 20 class DescriptorInfo : public DescriptorInfoBase { |
| 21 public: | 21 public: |
| 22 explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) { } | 22 explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) {} |
| 23 | 23 |
| 24 virtual ~DescriptorInfo() { } | 24 virtual ~DescriptorInfo() {} |
| 25 | 25 |
| 26 virtual void Close() { | 26 virtual void Close() { |
| 27 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 27 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
| 28 fd_ = -1; | 28 fd_ = -1; |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(DescriptorInfo); | 32 DISALLOW_COPY_AND_ASSIGN(DescriptorInfo); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class DescriptorInfoSingle | 35 class DescriptorInfoSingle : public DescriptorInfoSingleMixin<DescriptorInfo> { |
| 36 : public DescriptorInfoSingleMixin<DescriptorInfo> { | |
| 37 public: | 36 public: |
| 38 explicit DescriptorInfoSingle(intptr_t fd) | 37 explicit DescriptorInfoSingle(intptr_t fd) |
| 39 : DescriptorInfoSingleMixin(fd, false) {} | 38 : DescriptorInfoSingleMixin(fd, false) {} |
| 40 virtual ~DescriptorInfoSingle() {} | 39 virtual ~DescriptorInfoSingle() {} |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoSingle); | 42 DISALLOW_COPY_AND_ASSIGN(DescriptorInfoSingle); |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 class DescriptorInfoMultiple | 45 class DescriptorInfoMultiple |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 105 |
| 107 MagentaWaitManyInfo info_; | 106 MagentaWaitManyInfo info_; |
| 108 | 107 |
| 109 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); | 108 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
| 110 }; | 109 }; |
| 111 | 110 |
| 112 } // namespace bin | 111 } // namespace bin |
| 113 } // namespace dart | 112 } // namespace dart |
| 114 | 113 |
| 115 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ | 114 #endif // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_ |
| OLD | NEW |