Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: bin/eventhandler.dart

Issue 8537023: Implement automatic loading of dart:core_native_fields library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Create an empty class to represent the native fields used in
6 // the EventHandler class (it needs one native field).
7 class EventHandlerNativeWrapper extends NativeFieldWrapperClass1 {
8 }
9
5 class EventHandler extends EventHandlerNativeWrapper { 10 class EventHandler extends EventHandlerNativeWrapper {
6 EventHandler() { } 11 EventHandler() { }
7 12
8 static void _start() { 13 static void _start() {
9 if (_eventHandler === null) { 14 if (_eventHandler === null) {
10 _eventHandler = new EventHandler(); 15 _eventHandler = new EventHandler();
11 _eventHandler._doStart(); 16 _eventHandler._doStart();
12 } 17 }
13 } 18 }
14 19
15 void _doStart() native "EventHandler_Start"; 20 void _doStart() native "EventHandler_Start";
16 21
17 static _sendData(int id, ReceivePort receivePort, int data) { 22 static _sendData(int id, ReceivePort receivePort, int data) {
18 if (_eventHandler !== null) { 23 if (_eventHandler !== null) {
19 _eventHandler._doSendData(id, receivePort, data); 24 _eventHandler._doSendData(id, receivePort, data);
20 } 25 }
21 } 26 }
22 27
23 28
24 void _doSendData(int id, ReceivePort receivePort, int data) 29 void _doSendData(int id, ReceivePort receivePort, int data)
25 native "EventHandler_SendData"; 30 native "EventHandler_SendData";
26 31
27 static EventHandler _eventHandler; 32 static EventHandler _eventHandler;
28 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698