mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 938406 - DataStore - proper event sent when the first revision is created, r=ehsan
This commit is contained in:
parent
8e419cfcfb
commit
114ee4d87a
@ -9,7 +9,7 @@
|
||||
this.EXPORTED_SYMBOLS = ["DataStore"];
|
||||
|
||||
function debug(s) {
|
||||
// dump('DEBUG DataStore: ' + s + '\n');
|
||||
//dump('DEBUG DataStore: ' + s + '\n');
|
||||
}
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
@ -9,7 +9,7 @@
|
||||
this.EXPORTED_SYMBOLS = ['DataStoreCursor'];
|
||||
|
||||
function debug(s) {
|
||||
// dump('DEBUG DataStoreCursor: ' + s + '\n');
|
||||
//dump('DEBUG DataStoreCursor: ' + s + '\n');
|
||||
}
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
@ -9,7 +9,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
this.EXPORTED_SYMBOLS = ['DataStoreDB'];
|
||||
|
||||
function debug(s) {
|
||||
// dump('DEBUG DataStoreDB: ' + s + '\n');
|
||||
//dump('DEBUG DataStoreDB: ' + s + '\n');
|
||||
}
|
||||
|
||||
const DATASTOREDB_VERSION = 1;
|
||||
|
@ -9,7 +9,7 @@
|
||||
/* static functions */
|
||||
|
||||
function debug(s) {
|
||||
// dump('DEBUG DataStoreService: ' + s + '\n');
|
||||
//dump('DEBUG DataStoreService: ' + s + '\n');
|
||||
}
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
@ -137,17 +137,13 @@ DataStoreService.prototype = {
|
||||
request.onsuccess = function(aEvent) {
|
||||
let cursor = aEvent.target.result;
|
||||
if (cursor) {
|
||||
ppmm.broadcastAsyncMessage('datastore-first-revision-created',
|
||||
{ name: aName, owner: aOwner });
|
||||
debug("First revision already created.");
|
||||
self.enableDataStore(aAppId, aName, aOwner);
|
||||
} else {
|
||||
// If the revision doesn't exist, let's create the first one.
|
||||
db.addRevision(aRevisionStore, 0, REVISION_VOID, function() {
|
||||
debug("First revision created.");
|
||||
if (aName in self.stores && aAppId in self.stores[aName]) {
|
||||
self.stores[aName][aAppId].enabled = true;
|
||||
ppmm.broadcastAsyncMessage('datastore-first-revision-created',
|
||||
{ name: aName, owner: aOwner });
|
||||
}
|
||||
self.enableDataStore(aAppId, aName, aOwner);
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -155,6 +151,14 @@ DataStoreService.prototype = {
|
||||
);
|
||||
},
|
||||
|
||||
enableDataStore: function(aAppId, aName, aOwner) {
|
||||
if (aName in this.stores && aAppId in this.stores[aName]) {
|
||||
this.stores[aName][aAppId].enabled = true;
|
||||
ppmm.broadcastAsyncMessage('datastore-first-revision-created',
|
||||
{ name: aName, owner: aOwner });
|
||||
}
|
||||
},
|
||||
|
||||
addPermissions: function(aAppId, aName, aOrigin, aOwner, aReadOnly) {
|
||||
// When a new DataStore is installed, the permissions must be set for the
|
||||
// owner app.
|
||||
|
@ -9,7 +9,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
this.EXPORTED_SYMBOLS = ["DataStoreServiceInternal"];
|
||||
|
||||
function debug(s) {
|
||||
// dump('DEBUG DataStoreServiceInternal: ' + s + '\n');
|
||||
//dump('DEBUG DataStoreServiceInternal: ' + s + '\n');
|
||||
}
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
Loading…
Reference in New Issue
Block a user