зеркало из https://github.com/mozilla/gecko-dev.git
backout 3d0d92f2406b for not working properly
This commit is contained in:
Родитель
22b3e73265
Коммит
0cc253138e
|
@ -89,10 +89,6 @@ var gTimerRegistered = false;
|
|||
// Map of datasetId -> { interval: <integer>, callback: <function> }
|
||||
var gSyncCallbacks = {};
|
||||
|
||||
// Whether or not writes to the provider are expected.
|
||||
// e.g. save() and deleteAll()
|
||||
var gWritesAreExpected = false;
|
||||
|
||||
/**
|
||||
* nsITimerCallback implementation. Checks to see if it's time to sync any registered datasets.
|
||||
*
|
||||
|
@ -158,10 +154,7 @@ this.HomeProvider = Object.freeze({
|
|||
return false;
|
||||
}
|
||||
|
||||
gWritesAreExpected = true;
|
||||
callback(datasetId);
|
||||
gWritesAreExpected = false;
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
|
@ -299,10 +292,6 @@ HomeStorage.prototype = {
|
|||
* @resolves When the operation has completed.
|
||||
*/
|
||||
save: function(data) {
|
||||
if (!gWritesAreExpected) {
|
||||
Cu.reportError("HomeStorage: save() called outside of sync window");
|
||||
}
|
||||
|
||||
return Task.spawn(function save_task() {
|
||||
let db = yield getDatabaseConnection();
|
||||
try {
|
||||
|
@ -342,10 +331,6 @@ HomeStorage.prototype = {
|
|||
* @resolves When the operation has completed.
|
||||
*/
|
||||
deleteAll: function() {
|
||||
if (!gWritesAreExpected) {
|
||||
Cu.reportError("HomeStorage: deleteAll() called outside of sync window");
|
||||
}
|
||||
|
||||
return Task.spawn(function delete_all_task() {
|
||||
let db = yield getDatabaseConnection();
|
||||
try {
|
||||
|
|
Загрузка…
Ссылка в новой задаче