Bug 186429 - Send display link IPC message from display link thread.
Summary: Send display link IPC message from display link thread.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-08 07:19 PDT by Per Arne Vollan
Modified: 2018-06-12 00:11 PDT (History)
7 users (show)

See Also:


Attachments
Patch (7.44 KB, patch)
2018-06-08 07:21 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (7.44 KB, patch)
2018-06-08 08:20 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (8.47 KB, patch)
2018-06-08 08:58 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (3.37 KB, patch)
2018-06-08 09:55 PDT, Per Arne Vollan
ggaren: review+
Details | Formatted Diff | Diff
Patch for landing (3.32 KB, patch)
2018-06-08 10:21 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>