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 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated dart:html library. | 6 // Auto-generated dart:html library. |
7 | 7 |
8 #library("html"); | 8 #library('html'); |
9 | |
10 #import('dart:isolate'); | |
11 #import('dart:json'); | |
9 | 12 |
10 $!GENERATED_DART_FILES | 13 $!GENERATED_DART_FILES |
11 | 14 |
12 #source('../../dom/src/EventListener.dart'); | 15 #source('../../dom/src/EventListener.dart'); |
13 #source('../../dom/src/KeyLocation.dart'); | 16 #source('../../dom/src/KeyLocation.dart'); |
14 #source('../../dom/src/KeyName.dart'); | 17 #source('../../dom/src/KeyName.dart'); |
15 #source('../../dom/src/ReadyState.dart'); | 18 #source('../../dom/src/ReadyState.dart'); |
16 #source('../../dom/src/_Collections.dart'); | 19 #source('../../dom/src/_Collections.dart'); |
17 #source('../../dom/src/_XMLHttpRequestUtils.dart'); | 20 #source('../../dom/src/_XMLHttpRequestUtils.dart'); |
18 #source('../../html/src/IDBOpenDBRequest.dart'); | 21 #source('../../html/src/IDBOpenDBRequest.dart'); |
19 #source('../../html/src/Measurement.dart'); | 22 #source('../../html/src/Measurement.dart'); |
20 #source('../../html/src/shared_FactoryProviders.dart'); | 23 #source('../../html/src/shared_FactoryProviders.dart'); |
21 #source('../../html/src/frog_DOMImplementation.dart'); | 24 #source('../../html/src/frog_DOMImplementation.dart'); |
22 #source('../../html/src/frog_FactoryProviders.dart'); | 25 #source('../../html/src/frog_FactoryProviders.dart'); |
23 #source('../../html/src/frog_IDBKeyRangeFactoryProvider.dart'); | 26 #source('../../html/src/frog_IDBKeyRangeFactoryProvider.dart'); |
24 #source('../../html/src/frog_IDBOpenDBRequestImplementation.dart'); | 27 #source('../../html/src/frog_IDBOpenDBRequestImplementation.dart'); |
25 #source('../../html/src/frog_LocationWrapper.dart'); | 28 #source('../../html/src/frog_LocationWrapper.dart'); |
26 #source('../../dom/src/frog_TypedArrayFactoryProvider.dart'); | 29 #source('../../dom/src/frog_TypedArrayFactoryProvider.dart'); |
27 #source('../../html/src/_Testing.dart'); | 30 #source('../../html/src/_Testing.dart'); |
28 #source('../../html/src/Device.dart'); | 31 #source('../../html/src/Device.dart'); |
29 #source('../../dom/src/_ListIterators.dart'); | 32 #source('../../dom/src/_ListIterators.dart'); |
30 #source('../../dom/src/_Lists.dart'); | 33 #source('../../dom/src/_Lists.dart'); |
34 #source('../../isolate/serialization.dart'); | |
31 | 35 |
32 | 36 |
33 Window get window() native "return window;"; | 37 Window get window() native "return window;"; |
34 _WindowImpl get _window() native "return window;"; | 38 _WindowImpl get _window() native "return window;"; |
35 | 39 |
36 Document get document() native "return document;"; | 40 Document get document() native "return document;"; |
37 | 41 |
38 _DocumentImpl get _document() native "return document;"; | 42 _DocumentImpl get _document() native "return document;"; |
39 | 43 |
40 Element query(String selector) => _document.query(selector); | 44 Element query(String selector) => _document.query(selector); |
41 ElementList queryAll(String selector) => _document.queryAll(selector); | 45 ElementList queryAll(String selector) => _document.queryAll(selector); |
42 | 46 |
43 // Workaround for tags like <cite> that lack their own Element subclass -- | 47 // Workaround for tags like <cite> that lack their own Element subclass -- |
44 // Dart issue 1990. | 48 // Dart issue 1990. |
45 class _HTMLElementImpl extends _ElementImpl native "*HTMLElement" { | 49 class _HTMLElementImpl extends _ElementImpl native "*HTMLElement" { |
46 } | 50 } |
51 | |
vsm
2012/07/04 08:52:35
Let's add a comment here:
TODO(vsm): Move this to
| |
52 _serialize(var message) { | |
53 // TODO(kasperl): Specialize the serializer. | |
54 return new _Serializer().traverse(message); | |
55 } | |
56 | |
57 _deserialize(var message) { | |
58 return new _JsDeserializer().deserialize(message); | |
59 } | |
60 | |
61 class _JsDeserializer extends _Deserializer { | |
62 | |
63 deserializeSendPort(List x) { | |
64 num id = x[1]; | |
65 return new _JsSendPortSync(id); | |
66 } | |
67 | |
68 } | |
69 | |
70 class _JsSendPortSync implements SendPortSync { | |
71 | |
72 num _id; | |
73 _JsSendPortSync(this._id); | |
74 | |
75 callSync(var message) { | |
76 var serialized = _serialize(message); | |
77 var result = _call(_id, serialized); | |
78 return _deserialize(result); | |
79 } | |
80 | |
81 static _call(num id, var message) native @""" | |
82 var deserialized = _deserialize(message); | |
83 var result = ReceivePortSync.map[id].callback(deserialized); | |
84 return _serialize(result); | |
85 """; | |
86 | |
87 } | |
OLD | NEW |