Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a6e0627e073356842e414b20b5b005c4a17baa1
      
https://github.com/WebKit/WebKit/commit/7a6e0627e073356842e414b20b5b005c4a17baa1
  Author: Andres Gonzalez <andresg...@apple.com>
  Date:   2023-05-11 (Thu, 11 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/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm

  Log Message:
  -----------
  AX: Make AXGeometryManager thread safe.
https://bugs.webkit.org/show_bug.cgi?id=256625
<rdar://problem/109185522>

Reviewed by Tyler Wilcock.

There were several thread safety issues related to AXGeometryManager:
- Since AXIsolatedTree holds a reference to it, when the AXObjectCache goes 
away, the AXGeometryManager was kept alive and its Timer could fire causing 
random crashes. Now, the AXIsolatedTree releases its reference to the 
AXGeometryManager when the AXObjectCache is about to be destroyed, allowing the 
AXGeometryManager to be destroyed on the main thread.
- The destructor of AXGeometryManager now stops the Timer.
- The member m_primaryScreenRect is now guarded by a Lock since it is accessed 
in both threads.
- The initialization of m_primaryScreenRect is done later, right before it is 
needed instead of at construction time.

* Source/WebCore/accessibility/AXGeometryManager.cpp:
(WebCore::AXGeometryManager::AXGeometryManager):
(WebCore::AXGeometryManager::~AXGeometryManager):
(WebCore::AXGeometryManager::scheduleRenderingUpdate):
(WebCore::AXGeometryManager::initializePrimaryScreenRect):
(WebCore::AXGeometryManager::primaryScreenRect):
(WebCore::AXGeometryManager::primaryScreenRect const): Deleted.
* Source/WebCore/accessibility/AXGeometryManager.h:

* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreateIsolatedTree):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::removeTreeForPageID):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::geometryManager const):
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::primaryScreenRect const):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to