Title: [256956] branches/safari-609.1.20.0-branch/Source/WebKit
- Revision
- 256956
- Author
- alanc...@apple.com
- Date
- 2020-02-19 15:07:45 -0800 (Wed, 19 Feb 2020)
Log Message
Cherry-pick r256426. rdar://problem/59447008
[ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread()
https://bugs.webkit.org/show_bug.cgi?id=207509
<rdar://problem/59325466>
Reviewed by Chris Dumez.
Covered by existing tests.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::writeSizeFile):
Make sure completion handler is always called on the main thread.
Minor refactoring to make things more efficient.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-609.1.20.0-branch/Source/WebKit/ChangeLog (256955 => 256956)
--- branches/safari-609.1.20.0-branch/Source/WebKit/ChangeLog 2020-02-19 23:07:42 UTC (rev 256955)
+++ branches/safari-609.1.20.0-branch/Source/WebKit/ChangeLog 2020-02-19 23:07:45 UTC (rev 256956)
@@ -1,5 +1,40 @@
2020-02-19 Russell Epstein <repst...@apple.com>
+ Cherry-pick r256426. rdar://problem/59447008
+
+ [ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread()
+ https://bugs.webkit.org/show_bug.cgi?id=207509
+ <rdar://problem/59325466>
+
+ Reviewed by Chris Dumez.
+
+ Covered by existing tests.
+
+ * NetworkProcess/cache/CacheStorageEngine.cpp:
+ (WebKit::CacheStorage::Engine::writeSizeFile):
+ Make sure completion handler is always called on the main thread.
+ Minor refactoring to make things more efficient.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-02-11 Youenn Fablet <you...@apple.com>
+
+ [ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread()
+ https://bugs.webkit.org/show_bug.cgi?id=207509
+ <rdar://problem/59325466>
+
+ Reviewed by Chris Dumez.
+
+ Covered by existing tests.
+
+ * NetworkProcess/cache/CacheStorageEngine.cpp:
+ (WebKit::CacheStorage::Engine::writeSizeFile):
+ Make sure completion handler is always called on the main thread.
+ Minor refactoring to make things more efficient.
+
+2020-02-19 Russell Epstein <repst...@apple.com>
+
Cherry-pick r256383. rdar://problem/59446974
Unreviewed, rolling out r256314.
Modified: branches/safari-609.1.20.0-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (256955 => 256956)
--- branches/safari-609.1.20.0-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2020-02-19 23:07:42 UTC (rev 256955)
+++ branches/safari-609.1.20.0-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2020-02-19 23:07:45 UTC (rev 256956)
@@ -530,23 +530,25 @@
void Engine::writeSizeFile(const String& path, uint64_t size, CompletionHandler<void()>&& completionHandler)
{
- CompletionHandlerCallingScope completionHandlerCaller(WTFMove(completionHandler));
+ ASSERT(RunLoop::isMain());
+
if (!shouldPersist())
- return;
+ return completionHandler();
- m_ioQueue->dispatch([path = path.isolatedCopy(), size, completionHandlerCaller = WTFMove(completionHandlerCaller)]() mutable {
+ m_ioQueue->dispatch([path = path.isolatedCopy(), size, completionHandler = WTFMove(completionHandler)]() mutable {
LockHolder locker(globalSizeFileLock);
auto fileHandle = FileSystem::openFile(path, FileSystem::FileOpenMode::Write);
- auto closeFileHandler = makeScopeExit([&] {
+
+ if (FileSystem::isHandleValid(fileHandle)) {
+ FileSystem::truncateFile(fileHandle, 0);
+
+ auto value = String::number(size).utf8();
+ FileSystem::writeToFile(fileHandle, value.data(), value.length());
+
FileSystem::closeFile(fileHandle);
- });
- if (!FileSystem::isHandleValid(fileHandle))
- return;
+ }
- FileSystem::truncateFile(fileHandle, 0);
- FileSystem::writeToFile(fileHandle, String::number(size).utf8().data(), String::number(size).utf8().length());
-
- RunLoop::main().dispatch([completionHandlerCaller = WTFMove(completionHandlerCaller)]() mutable { });
+ RunLoop::main().dispatch(WTFMove(completionHandler));
});
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes