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

Unified Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1530303005: Separate prelinked and unlinked parts of summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/format.dart
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 3ce5b792c28d91029024a58162506d876175bfa2..d050d817553b82b54be3e6357999d97b036ca443 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -195,14 +195,11 @@ PrelinkedReferenceBuilder encodePrelinkedReference(builder.BuilderContext builde
}
class PrelinkedUnit {
- UnlinkedUnit _unlinked;
List<PrelinkedReference> _references;
PrelinkedUnit.fromJson(Map json)
- : _unlinked = json["unlinked"] == null ? null : new UnlinkedUnit.fromJson(json["unlinked"]),
- _references = json["references"]?.map((x) => new PrelinkedReference.fromJson(x))?.toList();
+ : _references = json["references"]?.map((x) => new PrelinkedReference.fromJson(x))?.toList();
- UnlinkedUnit get unlinked => _unlinked;
List<PrelinkedReference> get references => _references ?? const <PrelinkedReference>[];
}
@@ -213,14 +210,6 @@ class PrelinkedUnitBuilder {
PrelinkedUnitBuilder(builder.BuilderContext context);
- void set unlinked(UnlinkedUnitBuilder _value) {
- assert(!_finished);
- assert(!_json.containsKey("unlinked"));
- if (_value != null) {
- _json["unlinked"] = _value.finish();
- }
- }
-
void set references(List<PrelinkedReferenceBuilder> _value) {
assert(!_finished);
assert(!_json.containsKey("references"));
@@ -236,9 +225,8 @@ class PrelinkedUnitBuilder {
}
}
-PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {UnlinkedUnitBuilder unlinked, List<PrelinkedReferenceBuilder> references}) {
+PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {List<PrelinkedReferenceBuilder> references}) {
PrelinkedUnitBuilder builder = new PrelinkedUnitBuilder(builderContext);
- builder.unlinked = unlinked;
builder.references = references;
return builder;
}
@@ -1265,6 +1253,8 @@ class UnlinkedUnit {
_typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))?.toList(),
_variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x))?.toList();
+ UnlinkedUnit.fromBuffer(List<int> buffer) : this.fromJson(JSON.decode(UTF8.decode(buffer)));
+
String get libraryName => _libraryName ?? '';
List<UnlinkedReference> get references => _references ?? const <UnlinkedReference>[];
List<UnlinkedClass> get classes => _classes ?? const <UnlinkedClass>[];
@@ -1364,6 +1354,8 @@ class UnlinkedUnitBuilder {
}
}
+ List<int> toBuffer() => UTF8.encode(JSON.encode(finish()));
+
Map finish() {
assert(!_finished);
_finished = true;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698