RESOLVED FIXED 223089
Use BinarySemaphore in SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously()
https://bugs.webkit.org/show_bug.cgi?id=223089
Summary Use BinarySemaphore in SerializedScriptValue::writeBlobsToDiskForIndexedDBSyn...
Chris Dumez
Reported 2021-03-11 14:03:20 PST
Use BinarySemaphore in SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously() instead of a Condition. This simplifies the code a bit.
Attachments
Patch (2.42 KB, patch)
2021-03-11 14:05 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-03-11 14:05:23 PST
Geoffrey Garen
Comment 2 2021-03-11 14:07:39 PST
Comment on attachment 422963 [details] Patch r=me
Alex Christensen
Comment 3 2021-03-11 14:08:30 PST
View in context: https://bugs.webkit.org/attachment.cgi?id=422963&action=review > Source/WebCore/bindings/js/SerializedScriptValue.cpp:4159 > + callOnMainThread([this, &semaphore, &value] { Won't this do something different in UIWebView? Does this matter?
Chris Dumez
Comment 4 2021-03-11 14:11:50 PST
(In reply to Alex Christensen from comment #3) > View in context: > https://bugs.webkit.org/attachment.cgi?id=422963&action=review > > > Source/WebCore/bindings/js/SerializedScriptValue.cpp:4159 > > + callOnMainThread([this, &semaphore, &value] { > > Won't this do something different in UIWebView? Does this matter? I mentioned this in the changelog. I changed this intentionally. We're in WebCore here so we should be using callOnMainThread() in my opinion. Also note that the surrounding code is using isMainThread(), not isMainRunLoop().
Alex Christensen
Comment 5 2021-03-11 14:12:23 PST
Comment on attachment 422963 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422963&action=review Sounds good > Source/WebCore/bindings/js/SerializedScriptValue.cpp:4159 > + callOnMainThread([this, &semaphore, &value] { Won't this do something different in UIWebView? Does this matter?
Chris Dumez
Comment 6 2021-03-11 14:16:22 PST
(In reply to Chris Dumez from comment #4) > (In reply to Alex Christensen from comment #3) > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=422963&action=review > > > > > Source/WebCore/bindings/js/SerializedScriptValue.cpp:4159 > > > + callOnMainThread([this, &semaphore, &value] { > > > > Won't this do something different in UIWebView? Does this matter? > > I mentioned this in the changelog. I changed this intentionally. We're in > WebCore here so we should be using callOnMainThread() in my opinion. Also > note that the surrounding code is using isMainThread(), not isMainRunLoop(). I also checked the call site, it does: if (!isMainThread()) { value->writeBlobsToDiskForIndexedDBSynchronously(); return; } value->writeBlobsToDiskForIndexedDB() So for this call site, it was OK to call writeBlobsToDiskForIndexedDB() directly if isMainThread() returns true (potentially being the WebThread).
EWS
Comment 7 2021-03-11 14:40:05 PST
Committed r274300: <https://commits.webkit.org/r274300> All reviewed patches have been landed. Closing bug and clearing flags on attachment 422963 [details].
Radar WebKit Bug Importer
Comment 8 2021-03-11 14:41:18 PST
Note You need to log in before you can comment on or make changes to this bug.