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

Side by Side Diff: site/try/src/compilation_unit.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library trydart.compilationUnit;
6
7 import 'dart:async' show
8 Stream,
9 StreamController;
10
11 class CompilationUnitData {
12 final String name;
13 String content;
14
15 CompilationUnitData(this.name, this.content);
16 }
17
18 class CompilationUnit extends CompilationUnitData {
19 // Extending [CompilationUnitData] allows this class to hide the storage
20 // allocated for [content] without introducing new names. The conventional
21 // way of acheiving this is to introduce a library-private field, but library
22 // privacy isn't without problems.
23
24 static StreamController<CompilationUnit> controller =
25 new StreamController<CompilationUnit>(sync: false);
26
27 static Stream<CompilationUnit> get onChanged => controller.stream;
28
29 CompilationUnit(String name, String content)
30 : super(name, content);
31
32 void set content(String newContent) {
33 if (content != newContent) {
34 super.content = newContent;
35 controller.add(this);
36 }
37 }
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698