Bug 726189 - get rid of search engine 'used' attribute, since it causes unnecessary I/O r=gavin

This commit is contained in:
Raymond Lee 2012-05-24 11:45:22 +08:00
Родитель 6972ca5653
Коммит 76b6027c9a
1 изменённых файлов: 0 добавлений и 19 удалений

Просмотреть файл

@ -1116,17 +1116,6 @@ Engine.prototype = {
_iconUpdateURL: null, _iconUpdateURL: null,
// A reference to the timer used for lazily serializing the engine to file // A reference to the timer used for lazily serializing the engine to file
_serializeTimer: null, _serializeTimer: null,
// Whether this engine has been used since the cache was last recreated.
__used: null,
get _used() {
if (!this.__used)
this.__used = !!engineMetadataService.getAttr(this, "used");
return this.__used;
},
set _used(aValue) {
this.__used = aValue
engineMetadataService.setAttr(this, "used", aValue);
},
/** /**
* Retrieves the data from the engine's file. If the engine's dataType is * Retrieves the data from the engine's file. If the engine's dataType is
@ -2414,12 +2403,6 @@ Engine.prototype = {
if (!aResponseType) if (!aResponseType)
aResponseType = URLTYPE_SEARCH_HTML; aResponseType = URLTYPE_SEARCH_HTML;
// Check for updates on the first use of an app-shipped engine
if (this._isInAppDir && aResponseType == URLTYPE_SEARCH_HTML && !this._used) {
this._used = true;
engineUpdateService.update(this);
}
var url = this._getURLOfType(aResponseType); var url = this._getURLOfType(aResponseType);
if (!url) if (!url)
@ -2825,8 +2808,6 @@ SearchService.prototype = {
try { try {
addedEngine = new Engine(file, dataType, !isWritable); addedEngine = new Engine(file, dataType, !isWritable);
addedEngine._initFromFile(); addedEngine._initFromFile();
if (addedEngine._used)
addedEngine._used = false;
} catch (ex) { } catch (ex) {
LOG("_loadEnginesFromDir: Failed to load " + file.path + "!\n" + ex); LOG("_loadEnginesFromDir: Failed to load " + file.path + "!\n" + ex);
continue; continue;