Bug 213124 - In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on secondary thread.
Summary: In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called on...
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-06-12 07:10 PDT by Andres Gonzalez
Modified: 2020-06-12 12:30 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.91 KB, patch)
2020-06-12 07:25 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (5.95 KB, patch)
2020-06-12 10:54 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (5.95 KB, patch)
2020-06-12 10:55 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-06-12 07:10:23 PDT
In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on secondary thread.
Comment 1 Andres Gonzalez 2020-06-12 07:25:53 PDT
Created attachment 401727 [details]
Patch
Comment 2 chris fleizach 2020-06-12 09:56:04 PDT
Comment on attachment 401727 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        - The unsigned int range for object IDs was being overrun for large number of objects like in the case of the sample page in <rdar://problem/59331146>. INcreased the size of AXID to size_t.

INcreased -> Increased

> Source/WebCore/accessibility/AccessibilityObjectInterface.h:75
> +typedef size_t AXID;

should we make this a uint64_t
Comment 3 Andres Gonzalez 2020-06-12 10:54:13 PDT
Created attachment 401750 [details]
Patch
Comment 4 Andres Gonzalez 2020-06-12 10:55:52 PDT
Created attachment 401751 [details]
Patch
Comment 5 Andres Gonzalez 2020-06-12 11:11:28 PDT
(In reply to chris fleizach from comment #2)
> Comment on attachment 401727 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401727&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        - The unsigned int range for object IDs was being overrun for large number of objects like in the case of the sample page in <rdar://problem/59331146>. INcreased the size of AXID to size_t.
> 
> INcreased -> Increased

Fixed.
> 
> > Source/WebCore/accessibility/AccessibilityObjectInterface.h:75
> > +typedef size_t AXID;
> 
> should we make this a uint64_t

size_t is guarantied the largest unsigned integer range the system can handle. But we can make it a uint64_t if we prefer to specify the size explicitly.
Comment 6 EWS 2020-06-12 12:25:00 PDT
Committed r262966: <https://trac.webkit.org/changeset/262966>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401751 [details].
Comment 7 Radar WebKit Bug Importer 2020-06-12 12:25:19 PDT
<rdar://problem/64307457>
Comment 8 Darin Adler 2020-06-12 12:30:19 PDT
Comment on attachment 401751 [details]
Patch

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

> Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:68
> +    void setChildrenIDs(Vector<AXID>&& childrenIDs)
> +    {
> +        // FIXME: The following ASSERT should be met but it is commented out at the
> +        // moment because of <rdar://problem/63985646> After calling _AXUIElementUseSecondaryAXThread(true),
> +        // still receives client request on main thread.
> +        // ASSERT(axObjectCache()->canUseSecondaryAXThread() ? !isMainThread() : isMainThread());
> +        m_childrenIDs = childrenIDs;
> +    }

Style thought for the future:

Generally seems like a poor pattern to move code from .cpp files to headers without a strong motivation; long term across many source files it likely makes our code slower to compile so we better be sure there is a benefit. Also, larger class definitions with function bodies can make it harder to see the design of the class.

I see, thought, that *this* is the kind of simple setter that can be super efficient so it’s tempting to make it inlined. Even if doing that, I think it’s better style to do that outside the class definition so it’s easier to refactor (move to and from the .cpp file). And I think that global optimization may be effective at inlining even when we don’t move things to headers.