Bug 1842773 - Part 8: Implement ArrayBuffer.prototype.resize method. r=sfink
[gecko.git] / netwerk / cache2 / nsICachePurgeLock.idl
bloba0937a8922488b1b34fdaa2adebe5c493a917664
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"
6 interface nsIFile;
8 /**
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 {
15 /**
16 * Initializes the lock using the profile name and the current process's
17 * path.
18 * Will throw if a lock was already acquired successfully.
20 void lock(in AUTF8String profileName);
22 /**
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();
28 /**
29 * Releases the lock.
30 * This object may be locked again, potentially using a different path
31 * after unlocking.
33 void unlock();
35 /**
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);