Live image cache (#51485)

* Reland "Live image cache" (#51441)

This reverts commit 419a2853a8.

* Make evict safer
This commit is contained in:
Dan Field
2020-02-26 16:01:56 -08:00
committed by GitHub
parent 1a79592b4a
commit c75db98337
10 changed files with 875 additions and 68 deletions

View File

@@ -20,7 +20,7 @@ void main() {
final developer.ServiceProtocolInfo info = await developer.Service.getInfo();
if (info.serverUri == null) {
throw TestFailure('This test _must_ be run with --enable-vmservice.');
fail('This test _must_ be run with --enable-vmservice.');
}
await timelineObtainer.connect(info.serverUri);
await timelineObtainer.setDartFlags();
@@ -58,7 +58,8 @@ void main() {
'name': 'ImageCache.clear',
'args': <String, dynamic>{
'pendingImages': 1,
'cachedImages': 0,
'keepAliveImages': 0,
'liveImages': 1,
'currentSizeInBytes': 0,
'isolateId': isolateId,
}
@@ -149,7 +150,7 @@ class TimelineObtainer {
Future<void> close() async {
expect(_completers, isEmpty);
await _observatorySocket.close();
await _observatorySocket?.close();
}
}