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

Side by Side Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 833633004: File-based and multicast InstrumentationServer implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 instrumentation; 5 library instrumentation;
6 6
7 /** 7 /**
8 * The interface used by client code to communicate with an instrumentation 8 * The interface used by client code to communicate with an instrumentation
9 * server. 9 * server.
10 */ 10 */
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 /** 179 /**
180 * Convert the given [object] to a string. 180 * Convert the given [object] to a string.
181 */ 181 */
182 String _toString(Object object) { 182 String _toString(Object object) {
183 if (object == null) { 183 if (object == null) {
184 return 'null'; 184 return 'null';
185 } 185 }
186 return object.toString(); 186 return object.toString();
187 } 187 }
188 } 188 }
189
190 /**
191 * An [InstrumentationServer] that sends messages to multiple instances.
192 */
193 class MulticastInstrumentationServer implements InstrumentationServer {
194 final List<InstrumentationServer> _servers;
195
196 MulticastInstrumentationServer(this._servers);
197
198 @override
199 void log(String message) {
200 for (InstrumentationServer server in _servers) {
201 server.log(message);
202 }
203 }
204
205 @override
206 void logWithPriority(String message) {
207 for (InstrumentationServer server in _servers) {
208 server.logWithPriority(message);
209 }
210 }
211
212 @override
213 void shutdown() {
214 for (InstrumentationServer server in _servers) {
215 server.shutdown();
216 }
217 }
218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698