| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library instrumentation; |
| 6 |
| 7 /** |
| 8 * The interface used by client code to communicate with an instrumentation |
| 9 * server. |
| 10 */ |
| 11 abstract class InstrumentationServer { |
| 12 /** |
| 13 * Pass the given [message] to the instrumentation server so that it will be |
| 14 * logged with other messages. |
| 15 */ |
| 16 void log(String message); |
| 17 |
| 18 /** |
| 19 * Signal that the client is done communicating with the instrumentation |
| 20 * server. This method should be invoked exactly one time and no other methods |
| 21 * should be invoked on this instance after this method has been invoked. |
| 22 */ |
| 23 void shutdown(); |
| 24 } |
| 25 |
| 26 /** |
| 27 * An [InstrumentationServer] that ignores all instrumentation requests sent to |
| 28 * it. It can be used when no instrumentation data is to be collected as a way |
| 29 * to avoid needing to check for null values. |
| 30 */ |
| 31 class NullInstrumentationServer implements InstrumentationServer { |
| 32 /** |
| 33 * Initialize a newly created instance of this class. |
| 34 */ |
| 35 const NullInstrumentationServer(); |
| 36 |
| 37 @override |
| 38 void log(String message) { |
| 39 } |
| 40 |
| 41 @override |
| 42 void shutdown() { |
| 43 } |
| 44 } |
| OLD | NEW |