Bug 731968 - AddLivemark callback should wait for all the writes.

r=dietrich
This commit is contained in:
Marco Bonardo 2012-03-02 18:05:33 +01:00
parent 6880870df8
commit d03567ecf9

View File

@ -124,9 +124,9 @@ LivemarkService.prototype = {
stmt.finalize();
},
_onCacheReady: function LS__onCacheReady(aCallback)
_onCacheReady: function LS__onCacheReady(aCallback, aWaitForAsyncWrites)
{
if (this._pendingStmt) {
if (this._pendingStmt || aWaitForAsyncWrites) {
// The cache is still being populated, so enqueue the job to the Storage
// async thread. Ideally this should just dispatch a runnable to it,
// that would call back on the main thread, but bug 608142 made that
@ -421,7 +421,7 @@ LivemarkService.prototype = {
try {
aLivemarkCallback.onCompletion(result, livemark);
} catch(ex2) {}
});
}, true);
}
}
},