Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 5057850

Browse files
author
Nathan LaPre
committed
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
1 parent 9d832bd commit 5057850

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

accessible/interfaces/nsIAccessibilityService.idl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ interface nsIAccessibilityService : nsISupports
7878
*/
7979
nsIAccessible getAccessibleFromCache(in Node aNode);
8080

81+
/**
82+
* Set the active cache domains. If any given domains are not currently
83+
* active, then the accessibility service will enable them in all content
84+
* processes, causing them to be cached.
85+
*
86+
* @param aCacheDomains [in] the cache domains to set
87+
*/
88+
void setCacheDomains(in unsigned long long aCacheDomains);
89+
8190
/**
8291
* Create a new pivot for tracking a position and traversing a subtree.
8392
*

accessible/xpcom/xpcAccessibilityService.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ xpcAccessibilityService::GetAccessibleFromCache(nsINode* aNode,
229229
return NS_OK;
230230
}
231231

232+
NS_IMETHODIMP
233+
xpcAccessibilityService::SetCacheDomains(uint64_t aCacheDomains) {
234+
nsAccessibilityService* accService = GetAccService();
235+
if (!accService) {
236+
return NS_ERROR_SERVICE_NOT_AVAILABLE;
237+
}
238+
239+
accService->SetCacheDomains(aCacheDomains);
240+
return NS_OK;
241+
}
242+
232243
NS_IMETHODIMP
233244
xpcAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
234245
nsIAccessiblePivot** aPivot) {

0 commit comments

Comments
 (0)