commit f9fe39d8492e5f5e2bc09e1599c7b536ca18a477
parent 304c3faa920dfec0faa3b9c92b3ab145b9197b2c
Author: Mark Banner <standard8@mozilla.com>
Date: Sat, 15 Nov 2025 10:23:57 +0000
Bug 2000003 - Remove public version nsISearchService.getEnginesByExtensionID. r=search-reviewers,scunnane
This is no longer used outside the service, so we can make it fully private. The existing uses
are within the run-on-idle code which is also guarenteed to be after initialisation, hence we don't
need to await init in those cases.
Differential Revision: https://phabricator.services.mozilla.com/D272619
Diffstat:
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/toolkit/components/search/SearchService.sys.mjs b/toolkit/components/search/SearchService.sys.mjs
@@ -436,11 +436,6 @@ export class SearchService {
});
}
- async getEnginesByExtensionID(extensionID) {
- await this.init();
- return this.#getEnginesByExtensionID(extensionID);
- }
-
async findContextualSearchEngineByHost(host) {
await this.init();
let settings = await this._settings.get();
@@ -2852,7 +2847,7 @@ export class SearchService {
// There's a chance here that the WebExtension might not be
// installed any longer, even though the engine is. We'll deal
// with that in `checkWebExtensionEngines`.
- let engines = await this.getEnginesByExtensionID(match[1]);
+ let engines = this.#getEnginesByExtensionID(match[1]);
if (engines.length) {
lazy.logConsole.debug(
`Migrating ${engine.name} to WebExtension install`
@@ -3074,7 +3069,7 @@ export class SearchService {
* An Extension object containing data about the extension.
*/
async #upgradeExtensionEngine(extension) {
- let extensionEngines = await this.getEnginesByExtensionID(extension.id);
+ let extensionEngines = this.#getEnginesByExtensionID(extension.id);
for (let engine of extensionEngines) {
let isDefault = engine == this.defaultEngine;
diff --git a/toolkit/components/search/nsISearchService.idl b/toolkit/components/search/nsISearchService.idl
@@ -440,13 +440,6 @@ interface nsISearchService : nsISupports
Promise getAppProvidedEngines();
/**
- * Returns an array of search engines installed by a given extension.
- *
- * @returns an array of nsISearchEngine objects.
- */
- Promise getEnginesByExtensionID(in AString extensionID);
-
- /**
* Returns an engine definition if it's search url matches the host provided.
*
* @param host
diff --git a/tools/@types/generated/lib.gecko.xpcom.d.ts b/tools/@types/generated/lib.gecko.xpcom.d.ts
@@ -11689,7 +11689,6 @@ interface nsISearchService extends nsISupports, Enums<typeof nsISearchService_Op
getEngines(): Promise<any>;
getVisibleEngines(): Promise<any>;
getAppProvidedEngines(): Promise<any>;
- getEnginesByExtensionID(extensionID: string): Promise<any>;
findContextualSearchEngineByHost(host: string): Promise<any>;
shouldShowInstallPrompt(engine: any): Promise<any>;
addSearchEngine(engine: any): Promise<any>;