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

Side by Side Diff: pkg/analyzer_cli/test/build_mode_test.dart

Issue 3006543002: Cache PackageBundle instances in AnalyzerWorkerLoop and reuse for multiple requests. (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « pkg/analyzer_cli/pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_cli.test.built_mode; 5 library analyzer_cli.test.built_mode;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/file_system/memory_file_system.dart'; 9 import 'package:analyzer/file_system/memory_file_system.dart';
10 import 'package:analyzer_cli/src/build_mode.dart'; 10 import 'package:analyzer_cli/src/build_mode.dart';
(...skipping 14 matching lines...) Expand all
25 /** 25 /**
26 * [AnalyzerWorkerLoop] for testing. 26 * [AnalyzerWorkerLoop] for testing.
27 */ 27 */
28 class TestAnalyzerWorkerLoop extends AnalyzerWorkerLoop { 28 class TestAnalyzerWorkerLoop extends AnalyzerWorkerLoop {
29 final _TestWorkerLoopAnalyze _analyze; 29 final _TestWorkerLoopAnalyze _analyze;
30 30
31 TestAnalyzerWorkerLoop(AsyncWorkerConnection connection, [this._analyze]) 31 TestAnalyzerWorkerLoop(AsyncWorkerConnection connection, [this._analyze])
32 : super(new MemoryResourceProvider(), connection); 32 : super(new MemoryResourceProvider(), connection);
33 33
34 @override 34 @override
35 Future<Null> analyze(CommandLineOptions options) async { 35 Future<Null> analyze(CommandLineOptions options, inputs) async {
36 if (_analyze != null) { 36 if (_analyze != null) {
37 _analyze(options); 37 _analyze(options);
38 } 38 }
39 } 39 }
40 } 40 }
41 41
42 @reflectiveTest 42 @reflectiveTest
43 class WorkerLoopTest { 43 class WorkerLoopTest {
44 final TestStdinAsync stdinStream = new TestStdinAsync(); 44 final TestStdinAsync stdinStream = new TestStdinAsync();
45 final TestStdoutStream stdoutStream = new TestStdoutStream(); 45 final TestStdoutStream stdoutStream = new TestStdoutStream();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 List<int> _serializeProto(GeneratedMessage message) { 135 List<int> _serializeProto(GeneratedMessage message) {
136 var buffer = message.writeToBuffer(); 136 var buffer = message.writeToBuffer();
137 137
138 var writer = new CodedBufferWriter(); 138 var writer = new CodedBufferWriter();
139 writer.writeInt32NoTag(buffer.length); 139 writer.writeInt32NoTag(buffer.length);
140 writer.writeRawBytes(buffer); 140 writer.writeRawBytes(buffer);
141 141
142 return writer.toBuffer(); 142 return writer.toBuffer();
143 } 143 }
144 } 144 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698