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

Unified Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 814453003: Ensure shutdown is always called (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/instrumentation/instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index d965cae624300a5a8fbe5d04c6f21bc04a0ad0e5..f435fab6562de41b779a173aed596c467a65bbe6 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -42,8 +42,8 @@ class InstrumentationService {
/**
* An instrumentation service that will not log any instrumentation data.
*/
- static const InstrumentationService NULL_SERVICE =
- const InstrumentationService(null);
+ static final InstrumentationService NULL_SERVICE =
+ new InstrumentationService(null);
static const String TAG_NOTIFICATION = 'Noti';
static const String TAG_REQUEST = 'Req';
@@ -54,13 +54,13 @@ class InstrumentationService {
* The instrumentation server used to communicate with the server, or `null`
* if instrumentation data should not be logged.
*/
- final InstrumentationServer instrumentationServer;
+ InstrumentationServer _instrumentationServer;
/**
* Initialize a newly created instrumentation service to comunicate with the
* given [instrumentationServer].
*/
- const InstrumentationService(this.instrumentationServer);
+ InstrumentationService(this._instrumentationServer);
/**
* The current time, expressed as a decimal encoded number of milliseconds.
@@ -94,8 +94,9 @@ class InstrumentationService {
* should be invoked on this instance after this method has been invoked.
*/
void shutdown() {
- if (instrumentationServer != null) {
- instrumentationServer.shutdown();
+ if (_instrumentationServer != null) {
+ _instrumentationServer.shutdown();
+ _instrumentationServer = null;
}
}
@@ -103,8 +104,8 @@ class InstrumentationService {
* Log the given message with the given tag.
*/
void _log(String tag, String message) {
- if (instrumentationServer != null) {
- instrumentationServer.log('$_timestamp:$tag:$message');
+ if (_instrumentationServer != null) {
+ _instrumentationServer.log('$_timestamp:$tag:$message');
}
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698