Changeset 252264 in webkit
- Timestamp:
- Nov 8, 2019 3:01:40 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252261 r252264 1 2019-11-08 Antti Koivisto <antti@apple.com> 2 3 Use separate cache directory for development WebKit on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=204015 5 6 Reviewed by Youenn Fablet. 7 8 Replace the NetworkCache::lastStableVersion scheme with a completely separate directory. 9 This way potential bugs in development WebKit can't end up affecting system WebKit cache. 10 This also removes the need to keep lastStableVersion updated. 11 12 * NetworkProcess/cache/NetworkCacheStorage.cpp: 13 (WebKit::NetworkCache::makeCachePath): 14 15 Add '/Development' to cache path if this is not system WebKit. 16 17 (WebKit::NetworkCache::Storage::open): 18 (WebKit::NetworkCache::Storage::deleteOldVersions): 19 20 No need to avoid deleting lastStableVersion anymore. 21 22 * NetworkProcess/cache/NetworkCacheStorage.h: 23 1 24 2019-11-08 Per Arne Vollan <pvollan@apple.com> 2 25 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
r249313 r252264 144 144 }; 145 145 146 static String makeCachePath(const String& baseCachePath) 147 { 148 #if PLATFORM(MAC) 149 // Put development cache to a different directory to avoid affecting the system cache. 150 if (!AuxiliaryProcess::isSystemWebKit()) 151 return FileSystem::pathByAppendingComponent(baseCachePath, "Development"_s); 152 #endif 153 return baseCachePath; 154 } 155 146 156 static String makeVersionedDirectoryPath(const String& baseDirectoryPath) 147 157 { … … 165 175 } 166 176 167 RefPtr<Storage> Storage::open(const String& cachePath, Mode mode) 168 { 169 ASSERT(RunLoop::isMain()); 177 RefPtr<Storage> Storage::open(const String& baseCachePath, Mode mode) 178 { 179 ASSERT(RunLoop::isMain()); 180 181 auto cachePath = makeCachePath(baseCachePath); 170 182 171 183 if (!FileSystem::makeAllDirectories(makeVersionedDirectoryPath(cachePath))) 172 184 return nullptr; 185 173 186 auto salt = readOrMakeSalt(makeSaltFilePath(cachePath)); 174 187 if (!salt) 175 188 return nullptr; 189 176 190 return adoptRef(new Storage(cachePath, mode, *salt)); 177 191 } … … 1123 1137 if (directoryVersion >= version) 1124 1138 return; 1125 #if PLATFORM(MAC)1126 if (!AuxiliaryProcess::isSystemWebKit() && directoryVersion == lastStableVersion)1127 return;1128 #endif1129 1139 1130 1140 auto oldVersionPath = FileSystem::pathByAppendingComponent(cachePath, subdirName); -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
r252116 r252264 109 109 // Incrementing this number will delete all existing cache content for everyone. Do you really need to do it? 110 110 static const unsigned version = 15; 111 #if PLATFORM(MAC)112 /// Allow the last stable version of the cache to co-exist with the latest development one.113 static const unsigned lastStableVersion = 13;114 #endif115 111 116 112 String basePathIsolatedCopy() const;
Note: See TracChangeset
for help on using the changeset viewer.