OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 9 |
10 // Flags used to provide information and actions to the eventhandler | 10 // Flags used to provide information and actions to the eventhandler |
11 // when sending a message about a file descriptor. These flags should | 11 // when sending a message about a file descriptor. These flags should |
12 // be kept in sync with the constants in socket_impl.dart. For more | 12 // be kept in sync with the constants in socket_impl.dart. For more |
13 // information see the comments in socket_impl.dart | 13 // information see the comments in socket_impl.dart |
14 enum MessageFlags { | 14 enum MessageFlags { |
15 kInEvent = 0, | 15 kInEvent = 0, |
16 kOutEvent = 1, | 16 kOutEvent = 1, |
17 kErrorEvent = 2, | 17 kErrorEvent = 2, |
18 kCloseEvent = 3, | 18 kCloseEvent = 3, |
19 kCloseCommand = 8, | 19 kCloseCommand = 8, |
20 kShutdownReadCommand = 9, | 20 kShutdownReadCommand = 9, |
21 kShutdownWriteCommand = 10, | 21 kShutdownWriteCommand = 10, |
22 kListeningSocket = 16, | 22 kListeningSocket = 16, |
| 23 kPipe = 17, |
23 }; | 24 }; |
24 | 25 |
25 | 26 |
26 // The event handler delegation class is OS specific. | 27 // The event handler delegation class is OS specific. |
27 #if defined(TARGET_OS_LINUX) | 28 #if defined(TARGET_OS_LINUX) |
28 #include "bin/eventhandler_linux.h" | 29 #include "bin/eventhandler_linux.h" |
29 #elif defined(TARGET_OS_MACOS) | 30 #elif defined(TARGET_OS_MACOS) |
30 #include "bin/eventhandler_macos.h" | 31 #include "bin/eventhandler_macos.h" |
31 #elif defined(TARGET_OS_WINDOWS) | 32 #elif defined(TARGET_OS_WINDOWS) |
32 #include "bin/eventhandler_win.h" | 33 #include "bin/eventhandler_win.h" |
(...skipping 12 matching lines...) Expand all Loading... |
45 handler->delegate_.StartEventHandler(); | 46 handler->delegate_.StartEventHandler(); |
46 return handler; | 47 return handler; |
47 } | 48 } |
48 | 49 |
49 private: | 50 private: |
50 EventHandlerImplementation delegate_; | 51 EventHandlerImplementation delegate_; |
51 }; | 52 }; |
52 | 53 |
53 | 54 |
54 #endif // BIN_EVENTHANDLER_H_ | 55 #endif // BIN_EVENTHANDLER_H_ |
OLD | NEW |