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

Side by Side Diff: bin/inference/client.dart

Issue 1411523003: add a JsonInfoCodec class (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « bin/function_size_analysis.dart ('k') | bin/inference/print_summary.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// Client component to display [GlobalResult]s as a web app. 5 /// Client component to display [GlobalResult]s as a web app.
6 library dart2js_info.bin.inference.client; 6 library dart2js_info.bin.inference.client;
7 7
8 import 'dart:html' hide Entry; 8 import 'dart:html' hide Entry;
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'package:dart2js_info/info.dart'; 10 import 'package:dart2js_info/info.dart';
11 import 'package:dart2js_info/src/string_edit_buffer.dart'; 11 import 'package:dart2js_info/src/string_edit_buffer.dart';
12 import 'package:charcode/charcode.dart'; 12 import 'package:charcode/charcode.dart';
13 13
14 AllInfo data; 14 AllInfo data;
15 main() async { 15 main() async {
16 data = 16 data = new AllInfoJsonCodec()
17 new AllInfo.fromJson(JSON.decode(await HttpRequest.getString('/data'))); 17 .decode(JSON.decode(await HttpRequest.getString('/data')));
18 18
19 routeByHash(); 19 routeByHash();
20 window.onHashChange.listen((_) => routeByHash()); 20 window.onHashChange.listen((_) => routeByHash());
21 } 21 }
22 22
23 /// Does basic routing for the client UI. 23 /// Does basic routing for the client UI.
24 routeByHash() { 24 routeByHash() {
25 var hash = window.location.hash; 25 var hash = window.location.hash;
26 if (hash.isEmpty || hash == '#' || hash == '#!') { 26 if (hash.isEmpty || hash == '#' || hash == '#!') {
27 handleHomePage(); 27 handleHomePage();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 for (var entry in entries[metric]) { 125 for (var entry in entries[metric]) {
126 code.insert(entry.begin, '<span class="send ${cssClassName} inactive">', 126 code.insert(entry.begin, '<span class="send ${cssClassName} inactive">',
127 -entry.end); 127 -entry.end);
128 code.insert(entry.end, '</span>'); 128 code.insert(entry.end, '</span>');
129 } 129 }
130 } 130 }
131 } 131 }
132 } 132 }
133 133
134 _classNameForMetric(Metric metric) => metric.name.replaceAll(' ', '-'); 134 _classNameForMetric(Metric metric) => metric.name.replaceAll(' ', '-');
OLDNEW
« no previous file with comments | « bin/function_size_analysis.dart ('k') | bin/inference/print_summary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698