Skip to content

Commit 0097803

Browse files
authored
Open a fresh dir during LoadSkSLs (flutter#21050)
Fixes flutter#65258 The following devicelab tests should pass after this patch: - flutter_gallery_sksl_warmup__transition_perf_e2e_ios32 - flutter_gallery_sksl_warmup_ios32__transition_perf
1 parent bc1507a commit 0097803

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/common/persistent_cache.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ std::vector<PersistentCache::SkSLCache> PersistentCache::LoadSkSLs() {
190190
// However, we'd like to continue visit the asset dir even if this persistent
191191
// cache is invalid.
192192
if (IsValid()) {
193-
fml::VisitFiles(*sksl_cache_directory_, visitor);
193+
// In case `rewinddir` doesn't work reliably, load SkSLs from a freshly
194+
// opened directory (https://github.com/flutter/flutter/issues/65258).
195+
fml::UniqueFD fresh_dir =
196+
fml::OpenDirectoryReadOnly(*cache_directory_, kSkSLSubdirName);
197+
fml::VisitFiles(fresh_dir, visitor);
194198
}
195199

196200
std::unique_ptr<fml::Mapping> mapping = nullptr;

0 commit comments

Comments
 (0)