Bug 186429

Summary: Send display link IPC message from display link thread.
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, commit-queue, ews-watchlist, ggaren, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
ggaren: review+
Patch for landing none

Description Per Arne Vollan 2018-06-08 07:19:15 PDT
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.
Comment 1 Per Arne Vollan 2018-06-08 07:21:53 PDT
Created attachment 342258 [details]
Patch
Comment 2 Per Arne Vollan 2018-06-08 08:20:23 PDT
Created attachment 342265 [details]
Patch
Comment 3 EWS Watchlist 2018-06-08 08:22:58 PDT
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.
Comment 4 Per Arne Vollan 2018-06-08 08:58:17 PDT
Created attachment 342274 [details]
Patch
Comment 5 Per Arne Vollan 2018-06-08 09:55:54 PDT
Created attachment 342280 [details]
Patch
Comment 6 Radar WebKit Bug Importer 2018-06-08 09:56:46 PDT
<rdar://problem/40940061>
Comment 7 Geoffrey Garen 2018-06-08 10:02:41 PDT
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*.
Comment 8 Per Arne Vollan 2018-06-08 10:06:51 PDT
(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.
Comment 9 Per Arne Vollan 2018-06-08 10:21:44 PDT
Created attachment 342284 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2018-06-08 11:30:07 PDT
Comment on attachment 342284 [details]
Patch for landing

Clearing flags on attachment: 342284

Committed r232632: <https://trac.webkit.org/changeset/232632>