Bug 481437 - browser_library_open_leak.js is throwing, fixes also some throw in placesTxn.js test, r=dietrich, sdwilsh

This commit is contained in:
Marco Bonardo 2009-07-07 12:41:23 +02:00
Родитель 64d4e0bd5d
Коммит d82fe473c2
2 изменённых файлов: 24 добавлений и 7 удалений

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

@ -654,7 +654,12 @@ LivemarkLoadListener.prototype = {
this._processor.listener = this;
this._processor.parseAsync(null, channel.URI);
this._processor.onStartRequest(aRequest, aContext);
try {
this._processor.onStartRequest(aRequest, aContext);
}
catch (ex) {
Components.utils.reportError("Livemark Service: feed processor received an invalid channel for " + channel.URI.spec);
}
},
/**
@ -662,11 +667,16 @@ LivemarkLoadListener.prototype = {
*/
onStopRequest: function LLL_onStopRequest(aRequest, aContext, aStatus) {
if (!Components.isSuccessCode(aStatus)) {
// Something went wrong, try to load again in a bit
this._setResourceTTL(ERROR_EXPIRATION);
this._isAborted = true;
MarkLivemarkLoadFailed(this._livemark.folderId);
this._livemark.locked = false;
var lmService = Cc[LS_CONTRACTID].getService(Ci.nsILivemarkService);
// One of the reasons we could abort a request is when a livemark is
// removed, in such a case the livemark itemId would already be invalid.
if (lmService.isLivemark(this._livemark.folderId)) {
// Something went wrong, try to load again in a bit
this._setResourceTTL(ERROR_EXPIRATION);
MarkLivemarkLoadFailed(this._livemark.folderId);
}
return;
}
// Set an expiration on the livemark, for reloading the data

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

@ -412,9 +412,16 @@ TaggingService.prototype = {
getService(Ci.nsIThreadManager);
tm.mainThread.dispatch({
run: function() {
if (!self._tagFolders[aItemId] &&
self._bms.getItemType(aItemId) == self._bms.TYPE_FOLDER)
self._tagFolders[aItemId] = self._bms.getItemTitle(aItemId);
try {
if (!self._tagFolders[aItemId] &&
self._bms.getItemType(aItemId) == self._bms.TYPE_FOLDER)
self._tagFolders[aItemId] = self._bms.getItemTitle(aItemId);
}
catch(ex) {
// Could happen that the tag is removed just after it is added, for
// example with transactions. in such a case getting item type
// will fail and there's no reason to register the addition.
}
}
}, Ci.nsIThread.DISPATCH_NORMAL);
},