... so we can look at the size file and get the size of record without waiting for Caches to initialize.
Created attachment 383174 [details] Patch
Comment on attachment 383174 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383174&action=review > Source/WebKit/ChangeLog:8 > + No behavior change as the file is not in use now. I do not think we should do that in NetworkCacheStorage. Instead, we could do it in CacheStorage::Caches::writeRecord/removeRecord/writeCachesToDisk.
Created attachment 383313 [details] Patch
Comment on attachment 383313 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383313&action=review > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:470 > + m_ioQueue->dispatch([path = path.isolatedCopy(), size]() mutable { mutable? > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:481 > + auto sizeString = String::number(size).utf8(); Could be a oneliner. > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:512 > + return String::fromUTF8(buffer.data()).toUIntStrict(); toUInt64Strict > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h:88 > + static Optional<uint64_t> readSizeFile(const String& path); 'path' not really useful.
Created attachment 383319 [details] Patch for landing
Comment on attachment 383319 [details] Patch for landing Clearing flags on attachment: 383319 Committed r252351: <https://trac.webkit.org/changeset/252351>
All reviewed patches have been landed. Closing bug.
<rdar://problem/57100861>
It looks like the added assertion in https://trac.webkit.org/changeset/252351/webkit is causing testing to exit early on Mac and iOS wk2 debug Build: https://build.webkit.org/builders/Apple%20Mojave%20Debug%20WK2%20%28Tests%29/builds/5776 crash: Thread 6 Crashed:: Dispatch queue: com.apple.WebKit.CacheStorageEngine.serialBackground 0 com.apple.JavaScriptCore 0x000000012d434ad0 WTFCrash + 16 (Assertions.cpp:305) 1 com.apple.JavaScriptCore 0x000000012e94dbfb WTFCrashWithInfo(int, char const*, char const*, int) + 27 2 com.apple.JavaScriptCore 0x000000012d472958 WTF::FileSystemImpl::unlockAndCloseFile(int) + 104 (FileSystem.cpp:365) 3 com.apple.WebKit 0x000000010de4fc6a WebKit::CacheStorage::Engine::writeSizeFile(WTF::String const&, unsigned long long)::$_48::operator()() const::'lambda'()::operator()() const + 26 (CacheStorageEngine.cpp:474)
Reverted r252351 for reason: casued 50+ crashes on Mac and iOS wk2 debug Committed r252369: <https://trac.webkit.org/changeset/252369>
Created attachment 383375 [details] Patch
Created attachment 383396 [details] Patch for landing
Created attachment 383397 [details] Patch for landing
Comment on attachment 383397 [details] Patch for landing Clearing flags on attachment: 383397 Committed r252381: <https://trac.webkit.org/changeset/252381>