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

Unified Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1687583002: Add DirectoryBasedDartSdk.useSummary property. (Closed) Base URL: git@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
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/build_sdk_summaries.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/sdk_io.dart
diff --git a/pkg/analyzer/lib/src/generated/sdk_io.dart b/pkg/analyzer/lib/src/generated/sdk_io.dart
index 8cdb8f2ee7b430c9063ee734e8642350018ed651..4d21f44fd425d096509fbe2742c130c55a50c2c4 100644
--- a/pkg/analyzer/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer/lib/src/generated/sdk_io.dart
@@ -207,6 +207,11 @@ class DirectoryBasedDartSdk implements DartSdk {
JavaFile _libraryDirectory;
/**
+ * The flag that specifies whether SDK summary should be used.
+ */
+ bool _useSummary = false;
Brian Wilkerson 2016/02/09 20:41:07 I don't understand what the value of this flag is
+
+ /**
* The revision number of this SDK, or `"0"` if the revision number cannot be
* discovered.
*/
@@ -259,10 +264,12 @@ class DirectoryBasedDartSdk implements DartSdk {
SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
_analysisContext.sourceFactory = factory;
// Try to use summaries.
- SdkBundle sdkBundle = _getSummarySdkBundle();
- if (sdkBundle != null) {
- _analysisContext.resultProvider =
- new SdkSummaryResultProvider(_analysisContext, sdkBundle);
+ if (_useSummary) {
+ SdkBundle sdkBundle = _getSummarySdkBundle();
+ if (sdkBundle != null) {
+ _analysisContext.resultProvider =
+ new SdkSummaryResultProvider(_analysisContext, sdkBundle);
+ }
}
}
return _analysisContext;
@@ -390,6 +397,17 @@ class DirectoryBasedDartSdk implements DartSdk {
List<String> get uris => _libraryMap.uris;
/**
+ * Specify whether SDK summary should be used. This property can only be set
+ * before [context] was invoked.
Paul Berry 2016/02/09 20:36:08 s/was/is/
+ */
+ void set useSummary(bool use) {
+ if (_analysisContext != null) {
+ throw new StateError('SDK analysis context has been already created.');
+ }
+ _useSummary = use;
+ }
+
+ /**
* Return the name of the file containing the VM executable.
*/
String get vmBinaryName {
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/build_sdk_summaries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698