Bug 696179: properly cache null results for "alias" from the engineMetadataService so that we avoid hitting SQLite multiple times when entering text in the location bar, r=rflint

--HG--
extra : transplant_source : %17%3D%E7%D0%98%3B%D8Iv%F3UD%03%04%C2%E7%C0%3E%93%12
This commit is contained in:
Gavin Sharp 2011-10-20 15:44:53 -04:00
parent 0c03891ef4
commit f5a7d108ab

View File

@ -1005,8 +1005,9 @@ function Engine(aLocation, aSourceDataType, aIsReadOnly) {
}
Engine.prototype = {
// The engine's alias.
_alias: null,
// The engine's alias (can be null). Initialized to |undefined| to indicate
// not-initialized-from-engineMetadataService.
_alias: undefined,
// The data describing the engine. Is either an array of bytes, for Sherlock
// files, or an XML document element, for XML plugins.
_data: null,
@ -2201,7 +2202,7 @@ Engine.prototype = {
// nsISearchEngine
get alias() {
if (this._alias === null)
if (this._alias === undefined)
this._alias = engineMetadataService.getAttr(this, "alias");
return this._alias;