RESOLVED FIXED Bug 213689
Fix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback()
https://bugs.webkit.org/show_bug.cgi?id=213689
Summary Fix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback()
Chris Dumez
Reported 2020-06-27 17:47:59 PDT
Fix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback().
Attachments
Patch (2.17 KB, patch)
2020-06-27 17:50 PDT, Chris Dumez
no flags
Patch (2.13 KB, patch)
2020-06-28 13:47 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-06-27 17:48:15 PDT
Chris Dumez
Comment 2 2020-06-27 17:50:30 PDT
Darin Adler
Comment 3 2020-06-28 13:23:51 PDT
Comment on attachment 402976 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402976&action=review > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:906 > + dispatch_async(dispatch_get_main_queue(), ^{ Just curious: why did you select dispatch to the main queue over other techniques for running on the main thread? > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:907 > + auto screenProperties = WebCore::collectScreenProperties(); In a small function/tight context like this, I like just using one word names, like "properties" here. > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:908 > + for (auto& processPool : WebProcessPool::allProcessPools()) And "pool" here.
Chris Dumez
Comment 4 2020-06-28 13:28:22 PDT
(In reply to Darin Adler from comment #3) > Comment on attachment 402976 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=402976&action=review > > > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:906 > > + dispatch_async(dispatch_get_main_queue(), ^{ > > Just curious: why did you select dispatch to the main queue over other > techniques for running on the main thread? I am in a .mm file so I can use dispatch_async(). Dispatch_async() has the benefit of not requiring any “main thread / run loop initialization” and work always. I recently tried to fix a similar bug with RunLoop dispatch and it caused crashes in the api tests because the main runloop was not initialized yet. > > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:907 > > + auto screenProperties = WebCore::collectScreenProperties(); > > In a small function/tight context like this, I like just using one word > names, like "properties" here. > > > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:908 > > + for (auto& processPool : WebProcessPool::allProcessPools()) > > And "pool" here.
Chris Dumez
Comment 5 2020-06-28 13:47:13 PDT
EWS
Comment 6 2020-06-28 14:34:25 PDT
Committed r263636: <https://trac.webkit.org/changeset/263636> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403008 [details].
Note You need to log in before you can comment on or make changes to this bug.