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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_analysis.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
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_analysis.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index eb43c96b424b2208e81e1815586d7269aa197e72..cfab1d61bf24521556d38265c5f66eaf9859e5c0 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -18,7 +18,6 @@ import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/html.dart';
import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
/**
@@ -222,14 +221,10 @@ class PerformAnalysisOperation extends ServerOperation {
return;
}
// process results
- PerformanceTag prevTag = ServerPerformanceStatistics.notices.makeCurrent();
- try {
+ ServerPerformanceStatistics.notices.makeCurrentWhile(() {
_sendNotices(server, notices);
- ServerPerformanceStatistics.index.makeCurrent();
_updateIndex(server, notices);
Brian Wilkerson 2015/02/24 22:31:07 The execution of _updateIndex is no longer counted
scheglov 2015/02/24 22:33:05 Yes. All what it does is just scheduling indexing,
- } finally {
- prevTag.makeCurrent();
- }
+ });
// continue analysis
server.addOperation(new PerformAnalysisOperation(context, true));
}
@@ -319,14 +314,10 @@ class _DartIndexOperation extends _SingleFileOperation {
@override
void perform(AnalysisServer server) {
- PerformanceTag prevTag =
- ServerPerformanceStatistics.indexOperation.makeCurrent();
- try {
+ ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() {
Index index = server.index;
index.indexUnit(context, unit);
- } finally {
- prevTag.makeCurrent();
- }
+ });
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698