Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GTK][a11y] Unregister objects and clear cache when last client disco…
…nnect with ATSPI https://bugs.webkit.org/show_bug.cgi?id=234781 Reviewed by Adrian Perez de Castro. We currently register objects when there are clients asking for cached items or connect event listeners. We could unregister the objects and clear the cache if all the clients are disconnected. This patch adds a low priority timer to clear the cache and unregister the objects if there aren't new clients after 10 seconds since the last client disconnected. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::initializeRegistry): Remove the calls to registerTrees(), since it's now done by addClient() when the first client is added. (WebCore::AccessibilityAtspi::addEventListener): Call addClient(). (WebCore::AccessibilityAtspi::addClient): Register the trees if this is the first client. Add the client to the map and subscribe to NameOwnerChanged to remove the client when it's disconnected. (WebCore::AccessibilityAtspi::removeClient): Remove the client and start the clear cache timer if the clients map is empty. (WebCore::AccessibilityAtspi::cacheClearTimerFired): Unregister all the objects and clear the cache. (WebCore::AccessibilityAtspi::registerTrees const): Deleted. * accessibility/atspi/AccessibilityAtspi.h: (WebCore::AccessibilityAtspi::hasClients const): Return whether there are clients connected. (WebCore::AccessibilityAtspi::hasEventListeners const): Deleted. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::didUnregisterObject): Object was unregistered by the clear cache timer, reset the path and isRegistered members. * accessibility/atspi/AccessibilityObjectAtspi.h: * accessibility/atspi/AccessibilityRootAtspi.cpp: (WebCore::AccessibilityRootAtspi::registerTree): Return early if already registered. (WebCore::AccessibilityRootAtspi::didUnregisterTree): Tree was unregistered by the clear caceh timer, reset the treeIsRegistered member. (WebCore::AccessibilityRootAtspi::embedded): Check if there are clients. * accessibility/atspi/AccessibilityRootAtspi.h: Canonical link: https://commits.webkit.org/246039@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
75a37c7
commit 0a48158bbf31a1ca1aacdff49d3a05d4dd7df143
Showing
7 changed files
with
138 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters