| 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_H_ | 5 #ifndef BIN_EVENTHANDLER_H_ |
| 6 #define BIN_EVENTHANDLER_H_ | 6 #define BIN_EVENTHANDLER_H_ |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/isolate_data.h" | 9 #include "bin/isolate_data.h" |
| 10 | 10 |
| 11 // Flags used to provide information and actions to the eventhandler | 11 // Flags used to provide information and actions to the eventhandler |
| 12 // when sending a message about a file descriptor. These flags should | 12 // when sending a message about a file descriptor. These flags should |
| 13 // be kept in sync with the constants in socket_impl.dart. For more | 13 // be kept in sync with the constants in socket_impl.dart. For more |
| 14 // information see the comments in socket_impl.dart | 14 // information see the comments in socket_impl.dart |
| 15 enum MessageFlags { | 15 enum MessageFlags { |
| 16 kInEvent = 0, | 16 kInEvent = 0, |
| 17 kOutEvent = 1, | 17 kOutEvent = 1, |
| 18 kErrorEvent = 2, | 18 kErrorEvent = 2, |
| 19 kCloseEvent = 3, | 19 kCloseEvent = 3, |
| 20 kCloseCommand = 8, | 20 kCloseCommand = 8, |
| 21 kShutdownReadCommand = 9, | 21 kShutdownReadCommand = 9, |
| 22 kShutdownWriteCommand = 10, | 22 kShutdownWriteCommand = 10, |
| 23 kListeningSocket = 16, | 23 kListeningSocket = 16, |
| 24 kPipe = 17, | 24 kPipe = 17, |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 | 27 |
| 28 // The event handler delegation class is OS specific. | 28 // The event handler delegation class is OS specific. |
| 29 #if defined(TARGET_OS_LINUX) | 29 #if defined(TARGET_OS_ANDROID) |
| 30 #include "bin/eventhandler_android.h" |
| 31 #elif defined(TARGET_OS_LINUX) |
| 30 #include "bin/eventhandler_linux.h" | 32 #include "bin/eventhandler_linux.h" |
| 31 #elif defined(TARGET_OS_MACOS) | 33 #elif defined(TARGET_OS_MACOS) |
| 32 #include "bin/eventhandler_macos.h" | 34 #include "bin/eventhandler_macos.h" |
| 33 #elif defined(TARGET_OS_WINDOWS) | 35 #elif defined(TARGET_OS_WINDOWS) |
| 34 #include "bin/eventhandler_win.h" | 36 #include "bin/eventhandler_win.h" |
| 35 #else | 37 #else |
| 36 #error Unknown target os. | 38 #error Unknown target os. |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 class EventHandler { | 41 class EventHandler { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 isolate_data->event_handler = handler; | 56 isolate_data->event_handler = handler; |
| 55 return handler; | 57 return handler; |
| 56 } | 58 } |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 EventHandlerImplementation delegate_; | 61 EventHandlerImplementation delegate_; |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 | 64 |
| 63 #endif // BIN_EVENTHANDLER_H_ | 65 #endif // BIN_EVENTHANDLER_H_ |
| OLD | NEW |