зеркало из https://github.com/mozilla/gecko-dev.git
backout a8aeb5b375fb for causing bug 1017554
This commit is contained in:
Родитель
dc5f91d8f6
Коммит
167a073a75
|
@ -204,7 +204,7 @@ var gDatabaseEnsured = false;
|
||||||
* Creates the database schema.
|
* Creates the database schema.
|
||||||
*/
|
*/
|
||||||
function createDatabase(db) {
|
function createDatabase(db) {
|
||||||
return Task.spawn(function* () {
|
return Task.spawn(function create_database_task() {
|
||||||
yield db.execute(SQL.createItemsTable);
|
yield db.execute(SQL.createItemsTable);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ function createDatabase(db) {
|
||||||
* Migrates the database schema to a new version.
|
* Migrates the database schema to a new version.
|
||||||
*/
|
*/
|
||||||
function upgradeDatabase(db, oldVersion, newVersion) {
|
function upgradeDatabase(db, oldVersion, newVersion) {
|
||||||
return Task.spawn(function* () {
|
return Task.spawn(function upgrade_database_task() {
|
||||||
for (let v = oldVersion + 1; v <= newVersion; v++) {
|
for (let v = oldVersion + 1; v <= newVersion; v++) {
|
||||||
switch(v) {
|
switch(v) {
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -236,7 +236,7 @@ function upgradeDatabase(db, oldVersion, newVersion) {
|
||||||
* @resolves Handle on an opened SQLite database.
|
* @resolves Handle on an opened SQLite database.
|
||||||
*/
|
*/
|
||||||
function getDatabaseConnection() {
|
function getDatabaseConnection() {
|
||||||
return Task.spawn(function* () {
|
return Task.spawn(function get_database_connection_task() {
|
||||||
let db = yield Sqlite.openConnection({ path: DB_PATH });
|
let db = yield Sqlite.openConnection({ path: DB_PATH });
|
||||||
if (gDatabaseEnsured) {
|
if (gDatabaseEnsured) {
|
||||||
throw new Task.Result(db);
|
throw new Task.Result(db);
|
||||||
|
@ -335,7 +335,7 @@ HomeStorage.prototype = {
|
||||||
": you cannot save more than " + MAX_SAVE_COUNT + " items at once";
|
": you cannot save more than " + MAX_SAVE_COUNT + " items at once";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.spawn(function* () {
|
return Task.spawn(function save_task() {
|
||||||
let db = yield getDatabaseConnection();
|
let db = yield getDatabaseConnection();
|
||||||
try {
|
try {
|
||||||
yield db.executeTransaction(function save_transaction() {
|
yield db.executeTransaction(function save_transaction() {
|
||||||
|
@ -375,7 +375,7 @@ HomeStorage.prototype = {
|
||||||
* @resolves When the operation has completed.
|
* @resolves When the operation has completed.
|
||||||
*/
|
*/
|
||||||
deleteAll: function() {
|
deleteAll: function() {
|
||||||
return Task.spawn(function* () {
|
return Task.spawn(function delete_all_task() {
|
||||||
let db = yield getDatabaseConnection();
|
let db = yield getDatabaseConnection();
|
||||||
try {
|
try {
|
||||||
let params = { dataset_id: this.datasetId };
|
let params = { dataset_id: this.datasetId };
|
||||||
|
|
Загрузка…
Ссылка в новой задаче