When the display link callback is firing on the display link thread in the UI process, we schedule a function to be called on the main thread to send the IPC message to the WebContent process. Since Connection::send is thread-safe, we can just send the message from the display link thread.
Created attachment 342258 [details] Patch
Created attachment 342265 [details] Patch
Attachment 342265 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/mac/DisplayLink.h:36: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 342274 [details] Patch
Created attachment 342280 [details] Patch
<rdar://problem/40940061>
Comment on attachment 342280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=342280&action=review r=me > Source/WebKit/UIProcess/mac/DisplayLink.cpp:37 > - > + Please revert this whitespace change to keep svn history nice. > Source/WebKit/UIProcess/mac/DisplayLink.cpp:102 > + DisplayLink* displayLink = reinterpret_cast<DisplayLink*>(data); This can be static_cast. It's slightly better to static_cast because the compiler still enforces that you're not doing something weirder like turning a float or an int or a CVTimeStamp* into a DisplayLink*.
(In reply to Geoffrey Garen from comment #7) > Comment on attachment 342280 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=342280&action=review > > r=me > > > Source/WebKit/UIProcess/mac/DisplayLink.cpp:37 > > - > > + > > Please revert this whitespace change to keep svn history nice. > > > Source/WebKit/UIProcess/mac/DisplayLink.cpp:102 > > + DisplayLink* displayLink = reinterpret_cast<DisplayLink*>(data); > > This can be static_cast. It's slightly better to static_cast because the > compiler still enforces that you're not doing something weirder like turning > a float or an int or a CVTimeStamp* into a DisplayLink*. Thanks for reviewing! I will update the patch before landing.
Created attachment 342284 [details] Patch for landing
Comment on attachment 342284 [details] Patch for landing Clearing flags on attachment: 342284 Committed r232632: <https://trac.webkit.org/changeset/232632>