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

Unified Diff: pkg/scheduled_test/lib/src/task.dart

Issue 14394003: Use UnmodifiableListView to expose read-only lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 years, 8 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 | « pkg/scheduled_test/lib/src/schedule.dart ('k') | pkg/stack_trace/lib/src/trace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/task.dart
diff --git a/pkg/scheduled_test/lib/src/task.dart b/pkg/scheduled_test/lib/src/task.dart
index e77f531a678d8056200ed6bbee31ad03ba1866ea..2dfc127163953bc9f2a0a5f8da82271007f5d14d 100644
--- a/pkg/scheduled_test/lib/src/task.dart
+++ b/pkg/scheduled_test/lib/src/task.dart
@@ -27,10 +27,10 @@ class Task {
/// The queue to which this [Task] belongs.
final TaskQueue queue;
- // TODO(nweiz): make this a read-only view when issue 8321 is fixed.
/// Child tasks that have been spawned while running this task. This will be
/// empty if this task is a nested task.
- final children = new Queue<Task>();
+ List<Task> get children => new UnmodifiableListView(_children);
+ final _children = new Queue<Task>();
/// A [FutureGroup] that will complete once all current child tasks are
/// finished running. This will be null if no child tasks are currently
@@ -110,7 +110,7 @@ class Task {
/// finished.
Future runChild(fn(), String description) {
var task = new Task._child(fn, description, this);
- children.add(task);
+ _children.add(task);
if (_childGroup == null || _childGroup.completed) {
_childGroup = new FutureGroup();
}
« no previous file with comments | « pkg/scheduled_test/lib/src/schedule.dart ('k') | pkg/stack_trace/lib/src/trace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698