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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 #elif defined(TARGET_OS_MACOS) | 33 #elif defined(TARGET_OS_MACOS) |
34 #include "bin/eventhandler_macos.h" | 34 #include "bin/eventhandler_macos.h" |
35 #elif defined(TARGET_OS_WINDOWS) | 35 #elif defined(TARGET_OS_WINDOWS) |
36 #include "bin/eventhandler_win.h" | 36 #include "bin/eventhandler_win.h" |
37 #else | 37 #else |
38 #error Unknown target os. | 38 #error Unknown target os. |
39 #endif | 39 #endif |
40 | 40 |
41 class EventHandler { | 41 class EventHandler { |
42 public: | 42 public: |
43 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data) { | 43 void SendData(intptr_t id, Dart_Port dart_port, int64_t data) { |
44 delegate_.SendData(id, dart_port, data); | 44 delegate_.SendData(id, dart_port, data); |
45 } | 45 } |
46 | 46 |
47 void Shutdown() { | 47 void Shutdown() { |
48 delegate_.Shutdown(); | 48 delegate_.Shutdown(); |
49 } | 49 } |
50 | 50 |
51 static EventHandler* Start() { | 51 static EventHandler* Start() { |
52 EventHandler* handler = new EventHandler(); | 52 EventHandler* handler = new EventHandler(); |
53 handler->delegate_.Start(); | 53 handler->delegate_.Start(); |
54 IsolateData* isolate_data = | 54 IsolateData* isolate_data = |
55 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); | 55 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); |
56 isolate_data->event_handler = handler; | 56 isolate_data->event_handler = handler; |
57 return handler; | 57 return handler; |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 EventHandlerImplementation delegate_; | 61 EventHandlerImplementation delegate_; |
62 }; | 62 }; |
63 | 63 |
64 | 64 |
65 #endif // BIN_EVENTHANDLER_H_ | 65 #endif // BIN_EVENTHANDLER_H_ |
OLD | NEW |