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

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

Issue 1750763002: Partially revert notification of package map computation (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 0226b7c561a0676dadc9e034f8901ee0318299c7..40bd651ec7e85a61c713786a2ef1f3b980c02d6f 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -250,13 +250,6 @@ abstract class ContextManager {
List<String> get includedPaths;
/**
- * The stream that is notified when we are starting or ending the computation
- * of a package map. A value of `true` is added when the computation starts
- * and a value of `false` is added when the computation ends.
- */
- Stream<bool> get onComputingPackageMap;
-
- /**
* Return a list of all of the contexts reachable from the given
* [analysisRoot] (the context associated with [analysisRoot] and all of its
* descendants).
@@ -329,6 +322,12 @@ abstract class ContextManagerCallbacks {
void applyChangesToContext(Folder contextFolder, ChangeSet changeSet);
/**
+ * Signals that the context manager has started to compute a package map (if
+ * [computing] is `true`) or has finished (if [computing] is `false`).
+ */
+ void computingPackageMap(bool computing);
+
+ /**
* Remove the context associated with the given [folder]. [flushedFiles] is
* a list of the files which will be "orphaned" by removing this context
* (they will no longer be analyzed by any context).
@@ -461,12 +460,6 @@ class ContextManagerImpl implements ContextManager {
final ContextInfo rootInfo = new ContextInfo._root();
/**
- * The controller that is notified when we are starting or ending the
- * computation of a package map.
- */
- StreamController<bool> _onComputingPackageMapController;
-
- /**
* Stream subscription we are using to watch each analysis root directory for
* changes.
*/
@@ -482,12 +475,6 @@ class ContextManagerImpl implements ContextManager {
this.defaultContextOptions) {
absolutePathContext = resourceProvider.absolutePathContext;
pathContext = resourceProvider.pathContext;
- _onComputingPackageMapController = new StreamController.broadcast();
- }
-
- @override
- Stream<bool> get onComputingPackageMap {
- return _onComputingPackageMapController.stream;
}
@override
@@ -998,7 +985,7 @@ class ContextManagerImpl implements ContextManager {
return new NoPackageFolderDisposition(packageRoot: packageRoot);
} else {
PackageMapInfo packageMapInfo;
- _onComputingPackageMapController.add(true);
+ callbacks.computingPackageMap(true);
try {
// Try .packages first.
if (absolutePathContext.basename(packagespecFile.path) ==
@@ -1017,7 +1004,7 @@ class ContextManagerImpl implements ContextManager {
packageMapInfo = _packageMapProvider.computePackageMap(folder);
});
} finally {
- _onComputingPackageMapController.add(false);
+ callbacks.computingPackageMap(false);
}
for (String dependencyPath in packageMapInfo.dependencies) {
addDependency(dependencyPath);
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698