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

Unified Diff: tools/testing/dart/dependency_graph.dart

Issue 2863253002: Tighten up a bunch of types in test.dart. (Closed)
Patch Set: Merge branch 'master' into types-for-test Created 3 years, 7 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 | « tools/testing/dart/compiler_configuration.dart ('k') | tools/testing/dart/drt_updater.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/dependency_graph.dart
diff --git a/tools/testing/dart/dependency_graph.dart b/tools/testing/dart/dependency_graph.dart
index f7e43f800fb9bfdcff2431dc92e11e09fda82c9d..688987868366c0d5aafd4409db9f98cf64d7908b 100644
--- a/tools/testing/dart/dependency_graph.dart
+++ b/tools/testing/dart/dependency_graph.dart
@@ -28,15 +28,18 @@ import 'utils.dart';
*/
class Graph {
final _nodes = new Set<Node>();
- final _eventController = new StreamController<GraphEvent>();
- final _stateCounts = new Map<NodeState, int>();
- var _eventStream;
+ final StreamController<GraphEvent> _eventController;
+ final _stateCounts = <NodeState, int>{};
+ final Stream<GraphEvent> _eventStream;
bool _isSealed = false;
- Graph() {
- _eventStream = _eventController.stream.asBroadcastStream();
+ factory Graph() {
+ var controller = new StreamController<GraphEvent>();
+ return new Graph._(controller, controller.stream.asBroadcastStream());
}
+ Graph._(this._eventController, this._eventStream);
+
Iterable<Node> get nodes => _nodes;
Stream<GraphEvent> get events => _eventStream;
bool get isSealed => _isSealed;
@@ -88,7 +91,7 @@ class Graph {
_emitEvent(new StateChangedEvent(node, fromState, newState));
}
- _emitEvent(GraphEvent event) {
+ void _emitEvent(GraphEvent event) {
// We emit events asynchronously so the graph can be build up in small
// batches and the events are delivered in small batches.
Timer.run(() {
« no previous file with comments | « tools/testing/dart/compiler_configuration.dart ('k') | tools/testing/dart/drt_updater.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698