| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.serialization; | 5 library dart2js.serialization; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/scanner/precedence.dart' | 7 import 'package:front_end/src/fasta/scanner/precedence.dart' |
| 8 show PrecedenceInfo; | 8 show PrecedenceInfo; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 class DeserializerPlugin { | 932 class DeserializerPlugin { |
| 933 const DeserializerPlugin(); | 933 const DeserializerPlugin(); |
| 934 | 934 |
| 935 /// Called upon the deserialization of [element]. | 935 /// Called upon the deserialization of [element]. |
| 936 /// | 936 /// |
| 937 /// Use [getDecoder] to retrieve the data object with id [tag] stored for | 937 /// Use [getDecoder] to retrieve the data object with id [tag] stored for |
| 938 /// [element]. If not object is stored for [tag], [getDecoder] returns `null`. | 938 /// [element]. If not object is stored for [tag], [getDecoder] returns `null`. |
| 939 void onElement(Element element, ObjectDecoder getDecoder(String tag)) {} | 939 void onElement(Element element, ObjectDecoder getDecoder(String tag)) {} |
| 940 | 940 |
| 941 /// Called to deserialize custom data from [decoder]. | 941 /// Called to deserialize custom data from [decoder]. |
| 942 dynamic onData(ObjectDecoder decoder) {} | 942 dynamic onData(ObjectDecoder decoder) => null; |
| 943 } | 943 } |
| 944 | 944 |
| 945 /// Context for parallel deserialization. | 945 /// Context for parallel deserialization. |
| 946 class DeserializationContext { | 946 class DeserializationContext { |
| 947 final DiagnosticReporter reporter; | 947 final DiagnosticReporter reporter; |
| 948 final Resolution resolution; | 948 final Resolution resolution; |
| 949 final LibraryProvider libraryProvider; | 949 final LibraryProvider libraryProvider; |
| 950 Map<Uri, LibraryElement> _uriMap = <Uri, LibraryElement>{}; | 950 Map<Uri, LibraryElement> _uriMap = <Uri, LibraryElement>{}; |
| 951 List<Deserializer> deserializers = <Deserializer>[]; | 951 List<Deserializer> deserializers = <Deserializer>[]; |
| 952 List<DeserializerPlugin> plugins = <DeserializerPlugin>[]; | 952 List<DeserializerPlugin> plugins = <DeserializerPlugin>[]; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 | 1152 |
| 1153 /// Returns the value used to store [key] as a property in the encoding an | 1153 /// Returns the value used to store [key] as a property in the encoding an |
| 1154 /// [ObjectValue]. | 1154 /// [ObjectValue]. |
| 1155 /// | 1155 /// |
| 1156 /// Different encodings have different restrictions and capabilities as how | 1156 /// Different encodings have different restrictions and capabilities as how |
| 1157 /// to store a [Key] value. For instance: A JSON encoding needs to convert | 1157 /// to store a [Key] value. For instance: A JSON encoding needs to convert |
| 1158 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can | 1158 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can |
| 1159 /// choose to store a [Key] as an [int] or as the [Key] itself. | 1159 /// choose to store a [Key] as an [int] or as the [Key] itself. |
| 1160 getObjectPropertyValue(Key key); | 1160 getObjectPropertyValue(Key key); |
| 1161 } | 1161 } |
| OLD | NEW |