| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void SendData(intptr_t id, Dart_Port dart_port, int64_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(handler); |
| 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 friend class EventHandlerImplementation; |
| 61 EventHandlerImplementation delegate_; | 62 EventHandlerImplementation delegate_; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 | 65 |
| 65 #endif // BIN_EVENTHANDLER_H_ | 66 #endif // BIN_EVENTHANDLER_H_ |
| OLD | NEW |