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

Unified Diff: lib/src/util.dart

Issue 2201903004: add tool to get breakdown of deferred libraries by size (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 4 years, 4 months 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
Index: lib/src/util.dart
diff --git a/lib/src/util.dart b/lib/src/util.dart
index 1b8a0847b2373b6899b3a791db9c428289b01bd4..b00f4347ab0eb9dab935595c6aa3c4f17f830b0a 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -4,7 +4,12 @@
library dart2js_info.src.util;
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
import 'package:dart2js_info/info.dart';
+
import 'graph.dart';
/// Computes a graph of dependencies from [info].
@@ -124,3 +129,8 @@ String recursiveDiagnosticString(Measurements measurements, Metric metric) {
helper(metric);
return sb.toString();
}
+
+Future<AllInfo> infoFromFile(String fileName) async {
+ var file = await new File(fileName).readAsString();
+ return new AllInfoJsonCodec().decode(JSON.decode(file));
+}

Powered by Google App Engine
This is Rietveld 408576698