This API is available on Firefox OS for internal applications 仅。
SettingsLock
interface represents a lock on settings. it allows a script to modify settings asynchronously, but in a safe way: ordering is guaranteed and the no other script will modify the settings until the modification are done (the next lock objects will start processing after it has been closed).
Each call to
SettingsManager.createLock()
create a new
SettingsLock
对象。
所有
SettingsLock
objects are kept in a queue of active locks. When a
SettingsLock
object is created it's placed at the end of the queue. Calls to get/set places a request against the lock on which it's called. Requests run asynchronously and in the order they are placed against a lock. When the last request for a lock is run, and the success/error event against it has been fired, the lock is removed from the queue and the next lock start to be processed.
SettingsLock.closed
true
) or if it's still the active lock (
false
)
SettingsLock.set()
DOMRequest
对象。
SettingsLock.get()
DOMRequest
对象。
SettingsLock.clear()
get
and
set
are asynchronous). This method is added for testing and it deletes the whole settings DB!
Not part of any specification yet; however, this API will be discuss at W3C as part of the System Applications Working Group .