home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 83
/
MINAMI83.iso
/
Extra
/
DivXInstaller.exe
/
$PLUGINSDIR
/
GoogleToolbarFirefox.msi
/
xpi
/
amulet-jslib
/
multi-table-querier.js
< prev
next >
Wrap
Text File
|
2006-08-07
|
1KB
|
49 lines
function PROT_MultiTableQuerier(url, whiteTables, blackTables, listManager,
callback) {
this.debugZone = "multitablequerier";
this.url_ = url;
this.whiteTables_ = whiteTables;
this.blackTables_ = blackTables;
this.listManager_ = listManager;
this.whiteIdx_ = 0;
this.blackIdx_ = 0;
this.callback_ = callback;
}
PROT_MultiTableQuerier.prototype.run = function() {
var whiteTable = this.whiteTables_[this.whiteIdx_];
var blackTable = this.blackTables_[this.blackIdx_];
if (whiteTable) {
++this.whiteIdx_;
this.listManager_.safeExists(whiteTable, this.url_,
BindToObject(this.whiteTableCallback_,
this));
} else if (blackTable) {
++this.blackIdx_;
this.listManager_.safeExists(blackTable, this.url_,
BindToObject(this.blackTableCallback_,
this));
} else {
G_Debug(this, "Not found in any tables: " + this.url_);
this.callback_(PROT_ListWarden.NOT_FOUND);
this.callback_ = null;
}
}
PROT_MultiTableQuerier.prototype.whiteTableCallback_ = function(isFound) {
if (!isFound)
this.run();
else {
G_Debug(this, "Found in whitelist: " + this.url_)
this.callback_(PROT_ListWarden.IN_WHITELIST);
this.callback_ = null;
}
}
PROT_MultiTableQuerier.prototype.blackTableCallback_ = function(isFound) {
if (!isFound) {
this.run();
} else {
G_Debug(this, "Found in blacklist: " + this.url_)
this.callback_(PROT_ListWarden.IN_BLACKLIST);
this.callback_ = null;
}
}