diff options
Diffstat (limited to '')
-rw-r--r-- | toolkit/components/telemetry/app/TelemetryControllerParent.sys.mjs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/toolkit/components/telemetry/app/TelemetryControllerParent.sys.mjs b/toolkit/components/telemetry/app/TelemetryControllerParent.sys.mjs index b9f8d5f85a..9a15142349 100644 --- a/toolkit/components/telemetry/app/TelemetryControllerParent.sys.mjs +++ b/toolkit/components/telemetry/app/TelemetryControllerParent.sys.mjs @@ -256,6 +256,15 @@ export var TelemetryController = Object.freeze({ promiseInitialized() { return Impl.promiseInitialized(); }, + + /** + * Allows to trigger TelemetryControllers delayed initialization now and waiting for its completion. + * The returned promise is guaranteed to resolve before TelemetryController is shutting down. + * @return {Promise} Resolved when delayed TelemetryController initialization completed. + */ + ensureInitialized() { + return Impl.ensureInitialized(); + }, }); var Impl = { @@ -1158,6 +1167,18 @@ var Impl = { return this._delayedInitTaskDeferred.promise; }, + /** + * Allows to trigger TelemetryControllers delayed initialization now and waiting for its completion. + * This will complete before TelemetryController is shutting down. + * @return {Promise} Resolved when delayed TelemetryController initialization completed. + */ + ensureInitialized() { + if (this._delayedInitTask) { + return this._delayedInitTask.finalize(); + } + return Promise.resolve(); + }, + getCurrentPingData(aSubsession) { this._log.trace("getCurrentPingData - subsession: " + aSubsession); |