[webkit-changes] [WebKit/WebKit] 5fae84: AX: Avoid hitting the main thread during the const...

AndresGonzalezApple noreply at github.com
Wed May 10 04:16:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5fae8467d69f04234a4b62a3de17581508952939
      https://github.com/WebKit/WebKit/commit/5fae8467d69f04234a4b62a3de17581508952939
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-05-10 (Wed, 10 May 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXGeometryManager.cpp
    M Source/WebCore/accessibility/AXGeometryManager.h
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/AccessibilityObjectInterface.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
    M Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Avoid hitting the main thread during the construction of the isolated tree due to AXPrimaryScreenHeight.
https://bugs.webkit.org/show_bug.cgi?id=256526
<rdar://problem/109100219>

Reviewed by Tyler Wilcock.

To accomplish not hitting the main thread upon primary screen height requests, the following changes were necessary:
- Added the primaryScreenHeight() method to the AXCoreObject interface and implementation for both live and isolated objects.
- The implementation for the isolated objects rely on the AXGeometryManager caching the value.
- AXGeometryManager caches the primary screen height on construction and returns the cached value when requested.
- The AXGeometryManager is now a shared pointer instead of a unique_ptr so that both the AXObjectcache and the AXIsolatedTree can hold references to it.
- AXIsolatedTree construction methods now take an AXObjectcache by reference and keep a reference to the AXGeometryManager to use off the main thread.
- The AXGeometryManager is now a ThreadSafeRefCounted object.

In addition, the isolated objects representing the ScrollView and the WebArea now eagerly cache the title and description properties, otherwise caching them lazily causes a hit to the main thread during isolated tree construction.

Canonical link: https://commits.webkit.org/263896@main




More information about the webkit-changes mailing list