1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsISupports.idl"
9 * This object is a wrapper of MultiInstanceLock.
10 * It's intended to be used to ensure exclusive access to folders being
11 * deleted by the purgeHTTPCache background task.
13 [scriptable
,uuid(8abb21e3
-c6a0
-4b4d
-9333-cc0d72f2c23b
)]
14 interface nsICachePurgeLock
: nsISupports
{
16 * Initializes the lock using the profile name and the current process's
18 * Will throw if a lock was already acquired successfully.
20 void lock
(in AUTF8String profileName
);
23 * Returns true if another instance also holds the lock.
24 * Throws if called before lock was called, or after unlock was called.
26 bool isOtherInstanceRunning
();
30 * This object may be locked again, potentially using a different path
36 * Returns the file used to guarantee single access to a resource.
37 * This method is used to remove the lock file when no longer necessary.
39 nsIFile getLockFile
(in AUTF8String profileName
);