Bug 856273 - Filter SimplePush registrations() by app manifest URL. r=khuey

--HG--
extra : rebase_source : f01ab35375ff9d70e11d40a4426a8ef14f9166f1
This commit is contained in:
Nikhil Marathe 2013-04-03 13:03:57 -07:00
parent 0302be40e5
commit 175d12fdb2

View File

@ -160,13 +160,22 @@ this.PushDB.prototype = {
}
return;
}
var self = this;
this.newTxn(
"readonly",
kPUSHDB_STORE_NAME,
function txnCb(aTxn, aStore) {
var index = aStore.index("manifestURL");
index.mozGetAll().onsuccess = function(event) {
aTxn.result = event.target.result;
var range = self.dbGlobal.IDBKeyRange.only(aManifestURL);
aTxn.result = [];
index.openCursor(range).onsuccess = function(event) {
var cursor = event.target.result;
if (cursor) {
debug(cursor.value.manifestURL + " " + cursor.value.channelID);
aTxn.result.push(cursor.value);
cursor.continue();
}
}
},
aSuccessCb,