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

Side by Side Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2710193004: Fix SummaryDataStore to support using a ResourceProvider instead of dart:io (Closed)
Patch Set: Fix SummaryDataStore to support using a ResourceProvider instead of dart:io Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.sdk2; 5 library analyzer.src.generated.sdk2;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 @override 85 @override
86 AnalysisContext get context { 86 AnalysisContext get context {
87 if (_analysisContext == null) { 87 if (_analysisContext == null) {
88 _analysisContext = new SdkAnalysisContext(_analysisOptions); 88 _analysisContext = new SdkAnalysisContext(_analysisOptions);
89 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); 89 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
90 _analysisContext.sourceFactory = factory; 90 _analysisContext.sourceFactory = factory;
91 if (_useSummary) { 91 if (_useSummary) {
92 PackageBundle sdkBundle = getLinkedBundle(); 92 PackageBundle sdkBundle = getLinkedBundle();
93 if (sdkBundle != null) { 93 if (sdkBundle != null) {
94 SummaryDataStore dataStore = new SummaryDataStore([]); 94 SummaryDataStore dataStore =
95 new SummaryDataStore([], resourceProvider: resourceProvider);
95 dataStore.addBundle(null, sdkBundle); 96 dataStore.addBundle(null, sdkBundle);
96 _analysisContext.resultProvider = 97 _analysisContext.resultProvider =
97 new InputPackagesResultProvider(_analysisContext, dataStore); 98 new InputPackagesResultProvider(_analysisContext, dataStore);
98 } 99 }
99 } 100 }
100 } 101 }
101 return _analysisContext; 102 return _analysisContext;
102 } 103 }
103 104
104 @override 105 @override
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 SdkLibrariesReader_LibraryBuilder libraryBuilder = 892 SdkLibrariesReader_LibraryBuilder libraryBuilder =
892 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 893 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
893 // If any syntactic errors were found then don't try to visit the AST 894 // If any syntactic errors were found then don't try to visit the AST
894 // structure. 895 // structure.
895 if (!errorListener.errorReported) { 896 if (!errorListener.errorReported) {
896 unit.accept(libraryBuilder); 897 unit.accept(libraryBuilder);
897 } 898 }
898 return libraryBuilder.librariesMap; 899 return libraryBuilder.librariesMap;
899 } 900 }
900 } 901 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | pkg/analyzer/lib/src/summary/package_bundle_reader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698