From 0633db78a539f24881e2db6595fd4e28bbf769ee Mon Sep 17 00:00:00 2001 From: "florian%queze.net" Date: Fri, 25 Jan 2008 21:47:05 +0000 Subject: [PATCH] Bug 413954 - nsHandlerService.store fails to remove applications. r=myk, sr=dmose, a1.9=beltzner git-svn-id: svn://10.0.0.236/trunk@244013 18797224-902f-48f8-a5cc-f745e15eee43 --- .../uriloader/exthandler/nsHandlerService.js | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/mozilla/uriloader/exthandler/nsHandlerService.js b/mozilla/uriloader/exthandler/nsHandlerService.js index e2d4eae2eee..a3d1b71be84 100755 --- a/mozilla/uriloader/exthandler/nsHandlerService.js +++ b/mozilla/uriloader/exthandler/nsHandlerService.js @@ -20,6 +20,7 @@ * Contributor(s): * Myk Melez * Dan Mosedale + * Florian Queze * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -674,7 +675,7 @@ HandlerService.prototype = { let handlerAppID = this._getPossibleHandlerAppID(handlerApp); if (!this._hasResourceAssertion(infoID, NC_POSSIBLE_APP, handlerAppID)) { this._storeHandlerApp(handlerAppID, handlerApp); - this._addResourceTarget(infoID, NC_POSSIBLE_APP, handlerAppID); + this._addResourceAssertion(infoID, NC_POSSIBLE_APP, handlerAppID); } delete currentHandlerApps[handlerAppID]; } @@ -685,7 +686,7 @@ HandlerService.prototype = { // leave it clogged up with information about handler apps we don't care // about anymore. for (let handlerAppID in currentHandlerApps) { - this._removeTarget(infoID, NC_POSSIBLE_APP, handlerAppID); + this._removeResourceAssertion(infoID, NC_POSSIBLE_APP, handlerAppID); if (!this._existsResourceTarget(NC_POSSIBLE_APP, handlerAppID)) this._removeAssertions(handlerAppID); } @@ -1148,8 +1149,9 @@ HandlerService.prototype = { * @param propertyURI {string} the URI of the property * @param targetURI {string} the URI of the target */ - _addResourceTarget: function HS__addResourceTarget(sourceURI, propertyURI, - targetURI) { + _addResourceAssertion: function HS__addResourceAssertion(sourceURI, + propertyURI, + targetURI) { var source = this._rdf.GetResource(sourceURI); var property = this._rdf.GetResource(propertyURI); var target = this._rdf.GetResource(targetURI); @@ -1157,6 +1159,23 @@ HandlerService.prototype = { this._ds.Assert(source, property, target, true); }, + /** + * Remove an assertion with a resource target. + * + * @param sourceURI {string} the URI of the source + * @param propertyURI {string} the URI of the property + * @param targetURI {string} the URI of the target + */ + _removeResourceAssertion: function HS__removeResourceAssertion(sourceURI, + propertyURI, + targetURI) { + var source = this._rdf.GetResource(sourceURI); + var property = this._rdf.GetResource(propertyURI); + var target = this._rdf.GetResource(targetURI); + + this._ds.Unassert(source, property, target); + }, + /** * Whether or not a property of an RDF source has a given resource target. *