Bug 1794974: Part 6: Add xpcAccessibilityService::setCacheDomains, r=Jamie

This revision implements a simple way to set cache domains from XPCOM, which is
crucial for testing caching granularity.

Differential Revision: https://phabricator.services.mozilla.com/D220040
This commit is contained in:
Nathan LaPre 2024-09-09 23:02:21 +00:00
parent 9d832bd02b
commit 50578506c1
2 changed files with 20 additions and 0 deletions

View File

@ -78,6 +78,15 @@ interface nsIAccessibilityService : nsISupports
*/
nsIAccessible getAccessibleFromCache(in Node aNode);
/**
* Set the active cache domains. If any given domains are not currently
* active, then the accessibility service will enable them in all content
* processes, causing them to be cached.
*
* @param aCacheDomains [in] the cache domains to set
*/
void setCacheDomains(in unsigned long long aCacheDomains);
/**
* Create a new pivot for tracking a position and traversing a subtree.
*

View File

@ -229,6 +229,17 @@ xpcAccessibilityService::GetAccessibleFromCache(nsINode* aNode,
return NS_OK;
}
NS_IMETHODIMP
xpcAccessibilityService::SetCacheDomains(uint64_t aCacheDomains) {
nsAccessibilityService* accService = GetAccService();
if (!accService) {
return NS_ERROR_SERVICE_NOT_AVAILABLE;
}
accService->SetCacheDomains(aCacheDomains);
return NS_OK;
}
NS_IMETHODIMP
xpcAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
nsIAccessiblePivot** aPivot) {