Bug 1942239 - Add option to explicitly enable incremental origin initialization in...
[gecko.git] / toolkit / components / backgroundtasks / nsIBackgroundTasksRunner.idl
blobebc13494f13613076ac3378828c0bf8ca82dbd71
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 [scriptable, uuid(8cd92fce-1ec3-470a-ad09-c0de9d98497e)]
9 interface nsIBackgroundTasksRunner : nsISupports
11 /**
12 * Runs a background process in an independent detached process. Any process
13 * opened by this function can outlive the main process.
15 * This function is thread-safe.
17 * XXX: The use of base::LaunchApp can make a zombie process on Unix.
18 * See bug 1802559.
20 * @param aTaskName The name of the background task.
21 * (BackgroundTask_{name}.sys.mjs)
22 * @param aArgs The arguments that will be passed to the task process. Any
23 * needed escape will happen automatically.
25 void runInDetachedProcess(in ACString aTaskName,
26 in Array<ACString> aCommandLine);
28 /**
29 * Runs removeDirectory background task.
30 * `toolkit.background_tasks.remove_directory.testing.sleep_ms` can be set to
31 * make it wait for the given milliseconds for testing purpose.
33 * See BackgroundTask_removeDirectory.sys.mjs for details about the arguments.
35 void removeDirectoryInDetachedProcess(in ACString aParentDirPath,
36 in ACString aChildDirName,
37 in ACString aSecondsToWait,
38 in ACString aOtherFoldersSuffix,
39 [optional] in ACString aMetricsId);