From 2f87713d4074afe4970ae55256100b50819d5315 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Tue, 5 Feb 2019 11:17:21 -0800 Subject: [PATCH] Revert "Disable the persistent cache (#6835)" (#7689) This reverts commit 093b2fea8ac09fb1e9e0d712dbdecc0a09f2c1ad. For https://github.com/flutter/flutter/issues/24058, We now only get a "Program linking failed" error message on Windows Android simulators without crahsing. Skia seems to have handled the linking failure in https://skia-review.googlesource.com/c/skia/+/180372 by rebuilding the program. --- shell/common/persistent_cache.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/shell/common/persistent_cache.cc b/shell/common/persistent_cache.cc index 95d2b6f9ecf..c3f6ebf0250 100644 --- a/shell/common/persistent_cache.cc +++ b/shell/common/persistent_cache.cc @@ -40,8 +40,16 @@ PersistentCache* PersistentCache::GetCacheForProcess() { return gPersistentCache.get(); } -PersistentCache::PersistentCache() { - // TODO(chinmaygarde): Reenable caching, avoiding the windows crasher. +PersistentCache::PersistentCache() + : cache_directory_(std::make_shared( + CreateDirectory(fml::paths::GetCachesDirectory(), + { + "flutter_engine", // + blink::GetFlutterEngineVersion(), // + "skia", // + blink::GetSkiaVersion() // + }, + fml::FilePermission::kReadWrite))) { if (!IsValid()) { FML_LOG(WARNING) << "Could not acquire the persistent cache directory. " "Caching of GPU resources on disk is disabled.";