OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library script_inset_element; | 5 library script_inset_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/app.dart'; | 9 import 'package:observatory/app.dart'; |
10 import 'package:observatory/models.dart' as M; | 10 import 'package:observatory/models.dart' as M; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 _annotations.add(new LocalVariableAnnotation(_isolate, _instances, | 577 _annotations.add(new LocalVariableAnnotation(_isolate, _instances, |
578 _r.queue, location, | 578 _r.queue, location, |
579 variable['value'])); | 579 variable['value'])); |
580 } | 580 } |
581 } | 581 } |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
585 ButtonElement _newRefreshButton() { | 585 ButtonElement _newRefreshButton() { |
586 var button = new ButtonElement(); | 586 var button = new ButtonElement(); |
587 button.classes = const ['refresh']; | 587 button.classes = ['refresh']; |
588 button.onClick.listen((_) async { | 588 button.onClick.listen((_) async { |
589 button.disabled = true; | 589 button.disabled = true; |
590 await _refresh(); | 590 await _refresh(); |
591 button.disabled = false; | 591 button.disabled = false; |
592 }); | 592 }); |
593 button.title = 'Refresh coverage'; | 593 button.title = 'Refresh coverage'; |
594 button.text = '↺'; | 594 button.text = '↺'; |
595 return button; | 595 return button; |
596 } | 596 } |
597 | 597 |
598 ButtonElement _newToggleProfileButton() { | 598 ButtonElement _newToggleProfileButton() { |
599 ButtonElement button = new ButtonElement(); | 599 ButtonElement button = new ButtonElement(); |
600 button.classes = _includeProfile ? const ['toggle-profile', 'enabled'] | 600 button.classes = _includeProfile ? ['toggle-profile', 'enabled'] |
601 : const ['toggle-profile']; | 601 : ['toggle-profile']; |
602 button.title = 'Toggle CPU profile information'; | 602 button.title = 'Toggle CPU profile information'; |
603 button.onClick.listen((_) async { | 603 button.onClick.listen((_) async { |
604 _includeProfile = !_includeProfile; | 604 _includeProfile = !_includeProfile; |
605 button.classes.toggle('enabled'); | 605 button.classes.toggle('enabled'); |
606 button.disabled = true; | 606 button.disabled = true; |
607 _refresh(); | 607 _refresh(); |
608 button.disabled = false; | 608 button.disabled = false; |
609 }); | 609 }); |
610 button.text = '🔥'; | 610 button.text = '🔥'; |
611 return button; | 611 return button; |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 if (self) { | 1337 if (self) { |
1338 return selfTicks / sampleCount; | 1338 return selfTicks / sampleCount; |
1339 } else { | 1339 } else { |
1340 return totalTicks / sampleCount; | 1340 return totalTicks / sampleCount; |
1341 } | 1341 } |
1342 } | 1342 } |
1343 | 1343 |
1344 bool isHot(bool self) => _percent(self) > kHotThreshold; | 1344 bool isHot(bool self) => _percent(self) > kHotThreshold; |
1345 bool isMedium(bool self) => _percent(self) > kMediumThreshold; | 1345 bool isMedium(bool self) => _percent(self) > kMediumThreshold; |
1346 } | 1346 } |
OLD | NEW |