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

Unified Diff: sky/framework/components/fixed_height_scrollable.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_data.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/fixed_height_scrollable.dart
diff --git a/sky/framework/components/fixed_height_scrollable.dart b/sky/framework/components/fixed_height_scrollable.dart
index 7343b553037cb75738edd1ba3aa9c60aae38cef0..782f30b6f6ee900b8f9878e7b4b26ca9f2fb52c4 100644
--- a/sky/framework/components/fixed_height_scrollable.dart
+++ b/sky/framework/components/fixed_height_scrollable.dart
@@ -4,6 +4,7 @@
import '../animation/scroll_behavior.dart';
import '../fn.dart';
+import '../tracing.dart';
import 'dart:math' as math;
import 'dart:sky' as sky;
import 'dart:async';
@@ -30,22 +31,24 @@ abstract class FixedHeightScrollable extends Scrollable {
}) : super(key: key, scrollBehavior: scrollBehavior);
void _measureHeights() {
- if (_itemHeight != null)
- return;
- var root = getRoot();
- if (root == null)
- return;
- var item = root.firstChild.firstChild;
- if (item == null)
- return;
- sky.ClientRect scrollRect = root.getBoundingClientRect();
- sky.ClientRect itemRect = item.getBoundingClientRect();
- assert(scrollRect.height > 0);
- assert(itemRect.height > 0);
+ trace('FixedHeightScrollable::_measureHeights', () {
+ if (_itemHeight != null)
+ return;
+ var root = getRoot();
+ if (root == null)
+ return;
+ var item = root.firstChild.firstChild;
+ if (item == null)
+ return;
+ sky.ClientRect scrollRect = root.getBoundingClientRect();
+ sky.ClientRect itemRect = item.getBoundingClientRect();
+ assert(scrollRect.height > 0);
+ assert(itemRect.height > 0);
- setState(() {
- _height = scrollRect.height;
- _itemHeight = itemRect.height;
+ setState(() {
+ _height = scrollRect.height;
+ _itemHeight = itemRect.height;
+ });
});
}
« no previous file with comments | « sky/examples/stocks-fn/lib/stock_data.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698