OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 patch class _EventHandler { |
| 6 /* patch */ static void _start() { |
| 7 if (_eventHandler === null) { |
| 8 _eventHandler = new _EventHandlerImpl(); |
| 9 _eventHandler._start(); |
| 10 } |
| 11 } |
| 12 |
| 13 /* patch */ static _sendData(Object sender, |
| 14 ReceivePort receivePort, |
| 15 int data) { |
| 16 if (_eventHandler !== null) { |
| 17 _eventHandler._sendData(sender, receivePort, data); |
| 18 } |
| 19 } |
| 20 |
| 21 static _EventHandlerImpl _eventHandler; |
| 22 } |
| 23 |
| 24 |
| 25 class _EventHandlerImpl extends NativeFieldWrapperClass1 { |
| 26 _EventHandlerImpl() { } |
| 27 void _start() native "EventHandler_Start"; |
| 28 void _sendData(Object sender, ReceivePort receivePort, int data) |
| 29 native "EventHandler_SendData"; |
| 30 } |
OLD | NEW |