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

Side by Side Diff: runtime/observatory/lib/src/elements/helpers/rendering_scheduler.dart

Issue 2204563003: Converted Observatory cpu-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Added lifecycle tests Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:observatory/src/elements/helpers/rendering_queue.dart'; 7 import 'package:observatory/src/elements/helpers/rendering_queue.dart';
8 export 'package:observatory/src/elements/helpers/rendering_queue.dart'; 8 export 'package:observatory/src/elements/helpers/rendering_queue.dart';
9 9
10 /// A generic renderable object. 10 /// A generic renderable object.
11 abstract class Renderable { 11 abstract class Renderable {
12 void render(); 12 void render();
13 } 13 }
14 14
15 /// Event related to a Renderable rendering phase. 15 /// Event related to a Renderable rendering phase.
16 class RenderedEvent<T extends Renderable> { 16 class RenderedEvent<T> {
17 /// Renderable to which the event is related 17 /// Renderable to which the event is related
18 final T element; 18 final T element;
19 /// Is another rendering scheduled for this element. 19 /// Is another rendering scheduled for this element.
20 final bool otherRenderScheduled; 20 final bool otherRenderScheduled;
21 21
22 RenderedEvent(this.element, this.otherRenderScheduled) { 22 RenderedEvent(this.element, this.otherRenderScheduled) {
23 assert(element != null); 23 assert(element != null);
24 assert(otherRenderScheduled != null); 24 assert(otherRenderScheduled != null);
25 } 25 }
26 } 26 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (_notificationScheduled) return; 112 if (_notificationScheduled) return;
113 _notify(); 113 _notify();
114 _notificationScheduled = true; 114 _notificationScheduled = true;
115 } 115 }
116 116
117 Future _notify() async { 117 Future _notify() async {
118 _onRendered.add(new RenderedEvent<T>(element, _dirty)); 118 _onRendered.add(new RenderedEvent<T>(element, _dirty));
119 _notificationScheduled = false; 119 _notificationScheduled = false;
120 } 120 }
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698