зеркало из https://github.com/mozilla/gecko-dev.git
more EM bulletproofing
This commit is contained in:
Родитель
735cc13421
Коммит
ee6048c7b6
|
@ -1102,7 +1102,7 @@ nsThemeInstaller.prototype = {
|
||||||
// We do a basic version check first just to make sure we somehow weren't
|
// We do a basic version check first just to make sure we somehow weren't
|
||||||
// tricked into installing an incompatible theme...
|
// tricked into installing an incompatible theme...
|
||||||
this._themeID = this._em.canInstallItem(themeMetadata);
|
this._themeID = this._em.canInstallItem(themeMetadata);
|
||||||
if (this._themeID != -1) {
|
if (isNaN(parseInt(this._themeID))) {
|
||||||
// Create a logger to log install operations for uninstall
|
// Create a logger to log install operations for uninstall
|
||||||
this._writer = new nsInstallLogWriter(this._themeID, aIsProfile);
|
this._writer = new nsInstallLogWriter(this._themeID, aIsProfile);
|
||||||
this._writer.open();
|
this._writer.open();
|
||||||
|
@ -2008,10 +2008,17 @@ nsExtensionManager.prototype = {
|
||||||
// This function is called on the next startup
|
// This function is called on the next startup
|
||||||
_finalizeInstall: function (aExtensionID)
|
_finalizeInstall: function (aExtensionID)
|
||||||
{
|
{
|
||||||
|
var isProfile = this._ds.isProfileItem(aExtensionID);
|
||||||
|
if (aExtensionID == 0 || aExtensionID == -1) {
|
||||||
|
this._ds.removeCorruptItem(aExtensionID,
|
||||||
|
nsIUpdateItem.TYPE_EXTENSION,
|
||||||
|
isProfile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this._extInstaller)
|
if (!this._extInstaller)
|
||||||
this._extInstaller = new nsExtensionInstaller(this._ds);
|
this._extInstaller = new nsExtensionInstaller(this._ds);
|
||||||
|
|
||||||
var isProfile = this._ds.isProfileItem(aExtensionID);
|
|
||||||
this._extInstaller.install(aExtensionID, isProfile);
|
this._extInstaller.install(aExtensionID, isProfile);
|
||||||
|
|
||||||
// Update the Components Manifest
|
// Update the Components Manifest
|
||||||
|
@ -2896,6 +2903,14 @@ nsExtensionsDataSource.prototype = {
|
||||||
this._flush(aIsProfile);
|
this._flush(aIsProfile);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Removes a corrupt item entry from the extension list added due to
|
||||||
|
// buggy code in previous EM versions!
|
||||||
|
removeCorruptItem: function (aItemID, aItemType, aIsProfile)
|
||||||
|
{
|
||||||
|
this.removeItemMetadata(aItemID, aItemType);
|
||||||
|
this.removeItemFromContainer(aItemID, aItemType, aIsProfile);
|
||||||
|
},
|
||||||
|
|
||||||
addItemMetadata: function (aItemID, aItemType, aSourceDS, aIsProfile)
|
addItemMetadata: function (aItemID, aItemType, aSourceDS, aIsProfile)
|
||||||
{
|
{
|
||||||
var targetDS = aIsProfile ? this._profileExtensions : this._appExtensions;
|
var targetDS = aIsProfile ? this._profileExtensions : this._appExtensions;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче