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

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

Issue 303233007: First cut at server timing tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed some bugs, added tests Created 6 years, 7 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 ef7bfcb458cc3c9a7f9c8aec542791f906d3bdc3..80cc62451c9a2d77e01ce8c54f0118b3ab94299c 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -211,11 +211,17 @@ class AnalysisServer {
// Look for a context that has work to be done and then perform one task.
//
List<ChangeNotice> notices = null;
-// String contextId;
try {
AnalysisContext context = contextWorkQueue[0];
-// contextId = contextIdMap[context];
- // TODO(danrubel): Replace with context identifier or similar
+ //
+ // TODO(brianwilkerson) Add an optional function-valued parameter to
+ // performAnalysisTask that will be called when the task has been computed
+ // but before it is performed and send notification in the function:
+ //
+ // AnalysisResult result = context.performAnalysisTask((taskDescription) {
+ // sendStatusNotification(context.toString(), taskDescription);
+ // });
+ //
sendStatusNotification(context.toString());
AnalysisResult result = context.performAnalysisTask();
notices = result.changeNotices;
@@ -226,20 +232,19 @@ class AnalysisServer {
// remove the context form the work queue so we won't try to do more
// analysis on it.
contextWorkQueue.removeAt(0);
+ } else {
+ sendNotices(notices);
}
//
// Schedule this method to be run again if there is any more work to be
// done.
//
- if (!contextWorkQueue.isEmpty) {
+ if (contextWorkQueue.isEmpty) {
+ sendStatusNotification(null);
+ } else {
_scheduleTask();
}
}
- if (notices != null) {
- sendNotices(notices);
- } else {
- sendStatusNotification(null);
- }
}
/**
@@ -286,9 +291,9 @@ class AnalysisServer {
* the current context being analyzed or `null` if analysis is complete.
*/
void sendStatusNotification(String contextId) {
- if (contextId == lastStatusNotificationContextId) {
- return;
- }
+// if (contextId == lastStatusNotificationContextId) {
+// return;
+// }
lastStatusNotificationContextId = contextId;
Notification notification = new Notification(NOTIFICATION_STATUS);
Map<String, Object> analysis = new Map();

Powered by Google App Engine
This is Rietveld 408576698