I propose creating nsIURIContentListener2 extending nsIURIContentListener as follows:
interface nsIURIContentListener2 : nsIURIContentListener
{
/**
* This function is similar in concept to the IsPreferred() and
* CanHandleContent() functions of nsIURIContentListener. For
* listeners that implement this interface, it will be called before
* those functions when a channel is available. If this function
* returns false, that will mean this listener will no longer be
* bothered with this load. Listeners implementing this interface
* must still implement IsPreferred() and CanHandleContent() in a
* useful way.
*
* @param aContentType the type of the data //XXXbz this duplicates
* info on the channel, but the caller will already have this..
* @param aChannel the channel for this load // XXXbz nsIRequest here?
* @param aIsPreferred whether the listener should prefer this load
*/
boolean CanHandleLoad(in string aContentType, in nsIChannel aChannel,
in boolean aIsPreferred);
}My proposal would be to modify nsURILoader and nsDSURIContentListener to know about this interface as follows:
1) When the URILoader is looking for a listener, it will attempt to QI
listeners to this interface. If that succeeds, it will call
CanHandleLoad() before calling IsPreferred()/CanHandleContent()
2) nsDSURIContentListener will pass on CanHandleLoad() calls to its
parent listener, returning true if there is no parent.The idea here is that this allows parent listeners to pass even on loads that would normally be going through CanHandleContent (which is handled completely by the docshell).
-Boris _______________________________________________ mozilla-embedding mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-embedding
