diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /netwerk/cache2/nsICachePurgeLock.idl | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | netwerk/cache2/nsICachePurgeLock.idl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/netwerk/cache2/nsICachePurgeLock.idl b/netwerk/cache2/nsICachePurgeLock.idl new file mode 100644 index 0000000000..a0937a8922 --- /dev/null +++ b/netwerk/cache2/nsICachePurgeLock.idl @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +interface nsIFile; + +/** + * This object is a wrapper of MultiInstanceLock. + * It's intended to be used to ensure exclusive access to folders being + * deleted by the purgeHTTPCache background task. + */ +[scriptable,uuid(8abb21e3-c6a0-4b4d-9333-cc0d72f2c23b)] +interface nsICachePurgeLock : nsISupports { + /** + * Initializes the lock using the profile name and the current process's + * path. + * Will throw if a lock was already acquired successfully. + */ + void lock(in AUTF8String profileName); + + /** + * Returns true if another instance also holds the lock. + * Throws if called before lock was called, or after unlock was called. + */ + bool isOtherInstanceRunning(); + + /** + * Releases the lock. + * This object may be locked again, potentially using a different path + * after unlocking. + */ + void unlock(); + + /** + * Returns the file used to guarantee single access to a resource. + * This method is used to remove the lock file when no longer necessary. + */ + nsIFile getLockFile(in AUTF8String profileName); +}; |