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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 954013002: Replace try/finally with PerformanceTag.makeCurrentWhile(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 24df8123d8a6deb59dd0a26043f9a595105edc7f..88f2a1dfe00b1b974e053450d29bb717aaa004ae 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -572,9 +572,7 @@ class AnalysisServer {
void handleRequest(Request request) {
_performance.logRequest(request);
runZoned(() {
- PerformanceTag prevTag =
- ServerPerformanceStatistics.serverRequests.makeCurrent();
- try {
+ ServerPerformanceStatistics.serverRequests.makeCurrentWhile(() {
int count = handlers.length;
for (int i = 0; i < count; i++) {
try {
@@ -601,9 +599,7 @@ class AnalysisServer {
}
}
channel.sendResponse(new Response.unknownRequest(request));
- } finally {
- prevTag.makeCurrent();
- }
+ });
}, onError: (exception, stackTrace) {
sendServerErrorNotification(exception, stackTrace, fatal: true);
});
@@ -1338,12 +1334,6 @@ class ServerPerformanceStatistics {
new PerformanceTag('executionNotifications');
/**
- * The [PerformanceTag] for time spent in
- * PerformAnalysisOperation._updateIndex.
- */
- static PerformanceTag index = new PerformanceTag('index');
-
- /**
* The [PerformanceTag] for time spent performing a _DartIndexOperation.
*/
static PerformanceTag indexOperation = new PerformanceTag('indexOperation');

Powered by Google App Engine
This is Rietveld 408576698