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

Side by Side Diff: sky/framework/fn.dart

Issue 1017353002: Added a positional Component.fromArgs() constructor (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library fn; 5 library fn;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:sky' as sky; 9 import 'dart:sky' as sky;
10 import 'reflect.dart' as reflect; 10 import 'reflect.dart' as reflect;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 final int _order; 591 final int _order;
592 static int _currentOrder = 0; 592 static int _currentOrder = 0;
593 bool _stateful; 593 bool _stateful;
594 static Component _currentlyBuilding; 594 static Component _currentlyBuilding;
595 595
596 Component({ Object key, bool stateful }) 596 Component({ Object key, bool stateful })
597 : _stateful = stateful != null ? stateful : false, 597 : _stateful = stateful != null ? stateful : false,
598 _order = _currentOrder + 1, 598 _order = _currentOrder + 1,
599 super(key:key); 599 super(key:key);
600 600
601 Component.fromArgs(Object key, bool stateful)
602 : this(key: key, stateful: stateful);
603
601 void didMount() {} 604 void didMount() {}
602 void didUnmount() {} 605 void didUnmount() {}
603 606
604 // TODO(rafaelw): It seems wrong to expose DOM at all. This is presently 607 // TODO(rafaelw): It seems wrong to expose DOM at all. This is presently
605 // needed to get sizing info. 608 // needed to get sizing info.
606 sky.Node getRoot() => _root; 609 sky.Node getRoot() => _root;
607 610
608 void _remove() { 611 void _remove() {
609 assert(_built != null); 612 assert(_built != null);
610 assert(_root != null); 613 assert(_root != null);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 710
708 _sync(null, _host, null); 711 _sync(null, _host, null);
709 assert(_root is sky.Node); 712 assert(_root is sky.Node);
710 713
711 sw.stop(); 714 sw.stop();
712 if (_shouldLogRenderDuration) 715 if (_shouldLogRenderDuration)
713 print("Initial build: ${sw.elapsedMicroseconds} microseconds"); 716 print("Initial build: ${sw.elapsedMicroseconds} microseconds");
714 }); 717 });
715 } 718 }
716 } 719 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698