OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library js_backend.serialization; | 5 library js_backend.serialization; |
6 | 6 |
7 import '../common/backend_api.dart' show | 7 import '../common/backend_api.dart' show BackendSerialization; |
8 BackendSerialization; | |
9 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
10 import '../serialization/serialization.dart' show | 9 import '../serialization/serialization.dart' |
11 DeserializerPlugin, | 10 show DeserializerPlugin, ObjectDecoder, ObjectEncoder, SerializerPlugin; |
12 ObjectDecoder, | |
13 ObjectEncoder, | |
14 SerializerPlugin; | |
15 import '../serialization/keys.dart'; | 11 import '../serialization/keys.dart'; |
16 import 'js_backend.dart'; | 12 import 'js_backend.dart'; |
17 | 13 |
18 const String _BACKEND_DATA_TAG = 'jsBackendData'; | 14 const String _BACKEND_DATA_TAG = 'jsBackendData'; |
19 | 15 |
20 class JavaScriptBackendSerialization implements BackendSerialization { | 16 class JavaScriptBackendSerialization implements BackendSerialization { |
21 final JavaScriptBackendSerializer serializer; | 17 final JavaScriptBackendSerializer serializer; |
22 final JavaScriptBackendDeserializer deserializer; | 18 final JavaScriptBackendDeserializer deserializer; |
23 | 19 |
24 JavaScriptBackendSerialization(JavaScriptBackend backend) | 20 JavaScriptBackendSerialization(JavaScriptBackend backend) |
(...skipping 25 matching lines...) Expand all Loading... |
50 | 46 |
51 @override | 47 @override |
52 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { | 48 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { |
53 ObjectDecoder decoder = getDecoder(_BACKEND_DATA_TAG); | 49 ObjectDecoder decoder = getDecoder(_BACKEND_DATA_TAG); |
54 if (decoder != null) { | 50 if (decoder != null) { |
55 String nativeName = decoder.getString(Key.NAME); | 51 String nativeName = decoder.getString(Key.NAME); |
56 backend.nativeData.nativeMemberName[element] = nativeName; | 52 backend.nativeData.nativeMemberName[element] = nativeName; |
57 } | 53 } |
58 } | 54 } |
59 } | 55 } |
60 | |
OLD | NEW |