fune/toolkit/components/backgroundtasks
Nick Alexander ca22dc040c Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized
This commit does three main things:

1) It allows to configure the global singleton `nsUpdateSyncManager`
with an `nsIFile` rather than having it use the ambient XPCOM
directory service.  This allows to initialize the
`nsUpdateSyncManager` very early: before processing updates and long
before XPCOM is initialized.  This in turn allows us to determine if
other instances early enough to skip processing updates when
appropriate.

When this initialization path is followed, i.e., in Firefox but not
`xpcshell`, the `xpcom-startup` notification will be received but no
action taken, since the singleton will already exist.

There is a classic time-of-check, time-of-use race window in this
implementation: an instance may be launched immediately after we check
for other instances.  In practice this will result in behaviour that
is alreay possible: two independent instances both processing updates.
It is expected that the updater itself will exclude one of the
instances using its existing mutex.

2) It updates an existing background task test to use an explicit
`nsIFile` rather than the existing directory service method.  This
exercises the newer API.  There are other tests that might benefit,
but there's no harm in remaining with the previous approach, since
both are required.

3) It adds a new background task test to verify that update processing
is skipped if we're not the sole instance running.

Differential Revision: https://phabricator.services.mozilla.com/D106994
2021-03-06 05:40:39 +00:00
..
defaults Bug 1667276 - Part 3: Load a custom prefs file when running a background task. r=mossop,KrisWright 2021-01-27 22:54:25 +00:00
docs Bug 1695754 - Add developer documentation for the new --backgroundtask mode. r=bytesized DONTBUILD 2021-03-02 21:44:27 +00:00
tests Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized 2021-03-06 05:40:39 +00:00
BackgroundTask_exception.jsm Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00
BackgroundTask_failure.jsm Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00
BackgroundTask_success.jsm Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00
BackgroundTasks.cpp
BackgroundTasks.h Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00
BackgroundTasksManager.jsm Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00
components.conf
moz.build Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized 2021-03-06 05:40:39 +00:00
nsIBackgroundTasks.idl
nsIBackgroundTasksManager.idl Bug 1667276 - Part 2: Add BackgroundTasksManager to invoke task defined in JS. r=mossop 2021-01-27 22:54:17 +00:00