Bug 210760 - The rect for the primary screen should be retrieved on the main thread.
Summary: The rect for the primary screen should be retrieved on the main thread.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-20 12:21 PDT by Andres Gonzalez
Modified: 2020-04-23 08:40 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.96 KB, patch)
2020-04-20 12:26 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2020-04-20 12:21:33 PDT
The rect for the primary screen should be retrieved on the main thread.
Comment 1 Andres Gonzalez 2020-04-20 12:26:12 PDT
Created attachment 397001 [details]
Patch
Comment 2 EWS 2020-04-20 13:11:15 PDT
Committed r260392: <https://trac.webkit.org/changeset/260392>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397001 [details].
Comment 3 Radar WebKit Bug Importer 2020-04-20 13:12:15 PDT
<rdar://problem/62072352>
Comment 4 Darin Adler 2020-04-20 14:49:18 PDT
Comment on attachment 397001 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=397001&action=review

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1952
> +    static FloatRect screenRect;
> +    if (screenRect.isEmpty()) {
> +        screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
> +            return screenRectForPrimaryScreen();
> +        });
> +    }

You don’t need to add the if statement:

    static FloatRect screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
        return screenRectForPrimaryScreen();
    });
Comment 5 Andres Gonzalez 2020-04-23 08:40:07 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 397001 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=397001&action=review
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1952
> > +    static FloatRect screenRect;
> > +    if (screenRect.isEmpty()) {
> > +        screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
> > +            return screenRectForPrimaryScreen();
> > +        });
> > +    }
> 
> You don’t need to add the if statement:
> 
>     static FloatRect screenRect =
> Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
>         return screenRectForPrimaryScreen();
>     });

Fixed in https://bugs.webkit.org/show_bug.cgi?id=210914. Thanks!