Skip to content

Commit

Permalink
Open a fresh dir during LoadSkSLs (flutter#21050)
Browse files Browse the repository at this point in the history
Fixes flutter/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
  • Loading branch information
liyuqian authored Sep 9, 2020
1 parent bc1507a commit 0097803
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shell/common/persistent_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ std::vector<PersistentCache::SkSLCache> PersistentCache::LoadSkSLs() {
// However, we'd like to continue visit the asset dir even if this persistent
// cache is invalid.
if (IsValid()) {
fml::VisitFiles(*sksl_cache_directory_, visitor);
// In case `rewinddir` doesn't work reliably, load SkSLs from a freshly
// opened directory (https://github.com/flutter/flutter/issues/65258).
fml::UniqueFD fresh_dir =
fml::OpenDirectoryReadOnly(*cache_directory_, kSkSLSubdirName);
fml::VisitFiles(fresh_dir, visitor);
}

std::unique_ptr<fml::Mapping> mapping = nullptr;
Expand Down

0 comments on commit 0097803

Please sign in to comment.