summaryrefslogtreecommitdiffstats
path: root/toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs')
-rw-r--r--toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs13
1 files changed, 4 insertions, 9 deletions
diff --git a/toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs b/toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs
index 77b16d7ae9..0b35117d7a 100644
--- a/toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs
+++ b/toolkit/components/translations/actors/TranslationsEngineParent.sys.mjs
@@ -5,6 +5,7 @@
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
TranslationsParent: "resource://gre/actors/TranslationsParent.sys.mjs",
+ EngineProcess: "chrome://global/content/ml/EngineProcess.sys.mjs",
});
/**
@@ -22,12 +23,12 @@ export class TranslationsEngineParent extends JSWindowActorParent {
async receiveMessage({ name, data }) {
switch (name) {
case "TranslationsEngine:Ready":
- if (!lazy.TranslationsParent.resolveEngine) {
+ if (!lazy.EngineProcess.resolveTranslationsEngineParent) {
throw new Error(
"Unable to find the resolve function for when the translations engine is ready."
);
}
- lazy.TranslationsParent.resolveEngine(this);
+ lazy.EngineProcess.resolveTranslationsEngineParent(this);
return undefined;
case "TranslationsEngine:RequestEnginePayload": {
const { fromLanguage, toLanguage } = data;
@@ -62,12 +63,7 @@ export class TranslationsEngineParent extends JSWindowActorParent {
return undefined;
}
case "TranslationsEngine:DestroyEngineProcess":
- ChromeUtils.addProfilerMarker(
- "TranslationsEngine",
- {},
- "Loading bergamot wasm array buffer"
- );
- lazy.TranslationsParent.destroyEngineProcess().catch(error =>
+ lazy.EngineProcess.destroyTranslationsEngine().catch(error =>
console.error(error)
);
return undefined;
@@ -79,7 +75,6 @@ export class TranslationsEngineParent extends JSWindowActorParent {
/**
* @param {string} fromLanguage
* @param {string} toLanguage
- * @param {number} innerWindowId
* @param {MessagePort} port
* @param {number} innerWindowId
* @param {TranslationsParent} [translationsParent]