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

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

Issue 1503203002: Additional clean-up after moving to the new task model; a breaking change needed to allow a bug to … (Closed) Base URL: https://github.com/dart-lang/sdk.git@analyzer-breaking-0.27
Patch Set: Created 5 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 unified diff | Download patch
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 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:analyzer/task/model.dart'; 10 import 'package:analyzer/task/model.dart';
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 /** 98 /**
99 * The current time, expressed as a decimal encoded number of milliseconds. 99 * The current time, expressed as a decimal encoded number of milliseconds.
100 */ 100 */
101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); 101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString();
102 102
103 /** 103 /**
104 * Log that the given analysis [task] is being performed in the given 104 * Log that the given analysis [task] is being performed in the given
105 * [context]. 105 * [context].
106 */ 106 */
107 void logAnalysisTask(String context, dynamic task) { 107 void logAnalysisTask(String context, AnalysisTask task) {
108 // TODO(brianwilkerson) When the old task model is removed, change the
109 // parameter type to AnalysisTask.
110 if (_instrumentationServer != null) { 108 if (_instrumentationServer != null) {
111 String description = 109 String description =
112 (task is AnalysisTask) ? task.description : task.toString(); 110 (task is AnalysisTask) ? task.description : task.toString();
113 _instrumentationServer 111 _instrumentationServer
114 .log(_join([TAG_ANALYSIS_TASK, context, description])); 112 .log(_join([TAG_ANALYSIS_TASK, context, description]));
115 } 113 }
116 } 114 }
117 115
118 /** 116 /**
119 * Log the fact that an error, described by the given [message], has occurred. 117 * Log the fact that an error, described by the given [message], has occurred.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 371 }
374 } 372 }
375 373
376 @override 374 @override
377 Future shutdown() async { 375 Future shutdown() async {
378 for (InstrumentationServer server in _servers) { 376 for (InstrumentationServer server in _servers) {
379 await server.shutdown(); 377 await server.shutdown();
380 } 378 }
381 } 379 }
382 } 380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698