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

Unified Diff: sky/examples/stocks-fn/lib/stock_data.dart

Issue 1028243003: Let Dart code running in Sky add events to the trace timeline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: more Created 5 years, 9 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
« no previous file with comments | « sky/examples/stocks-fn/lib/stock_app.dart ('k') | sky/framework/components/fixed_height_scrollable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/lib/stock_data.dart
diff --git a/sky/examples/stocks-fn/lib/stock_data.dart b/sky/examples/stocks-fn/lib/stock_data.dart
index 17e083c1cc3112e87fbfb22c1750127aeacef57b..26ff2f017f8192b323222933e9e7168b7f22872c 100644
--- a/sky/examples/stocks-fn/lib/stock_data.dart
+++ b/sky/examples/stocks-fn/lib/stock_data.dart
@@ -5,16 +5,12 @@
import 'dart:convert';
import 'dart:math';
import 'package:sky/framework/net/fetch.dart';
+import 'package:sky/framework/tracing.dart';
// Snapshot from http://www.nasdaq.com/screening/company-list.aspx
// Fetched 2/23/2014.
// "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote",
-// final List<List<String>> _kCompanyList = [
-// ["TFSC","1347 Capital Corp.","9.43","\$56.09M","2014","Finance","Business Services","http://www.nasdaq.com/symbol/tfsc"],
-// ["TFSCR","1347 Capital Corp.","0.37","n/a","2014","Finance","Business Services","http://www.nasdaq.com/symbol/tfscr"],
-// ["TFSCU","1347 Capital Corp.","9.97","\$41.67M","2014","n/a","n/a","http://www.nasdaq.com/symbol/tfscu"],
-// ["TFSCW","1347 Capital Corp.","0.2","n/a","2014","Finance","Business Services","http://www.nasdaq.com/symbol/tfscw"],
-// ];
+// Data in stock_data.json
class Stock {
String symbol;
@@ -60,8 +56,11 @@ class StockOracle {
Future<StockOracle> fetchStockOracle() async {
Response response = await fetch('lib/stock_data.json');
- String json = response.bodyAsString();
- JsonDecoder decoder = new JsonDecoder();
- var companyList = decoder.convert(json);
- return new StockOracle.fromCompanyList(companyList);
+
+ return trace('stocks::fetchStockOracle', () {
+ String json = response.bodyAsString();
+ JsonDecoder decoder = new JsonDecoder();
+ var companyList = decoder.convert(json);
+ return new StockOracle.fromCompanyList(companyList);
+ });
}
« no previous file with comments | « sky/examples/stocks-fn/lib/stock_app.dart ('k') | sky/framework/components/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698