Boris Zbarsky wrote:
Phil H�hn wrote:

So your object registers itself for this contract, overriding the Mozilla urichecker?

Yes, it does register itself for this contract.... 'override the Moz urichecker'?? Is there one already (that I can use)?

Well, what does calling createInstance() on that contractid give you without your changes? You get an instance of nsURIChecker.

I'm not sure if you are asking me something or telling me something, sorry :-) ... the line of code I have is
this.linkChecker = Components.classes["@mozilla.org/network/urichecker;1"].createInstance(Components.interfaces.nsIURIChecker);
after a couple of things are set, the code calls:
this.linkChecker.asyncCheck(this, null);
(I.e as in 'save page as' code in contentAreaUtils.js)


However if I create a second object (same type of class, i.e validate page URL and setup callback) then the first callback doesn't get called.

Does this second object _also_ register itself for the same contract?


You can only have one class registered for a particular contractid; if another one is registered, it takes over the handling of the contractid.

Ah, that's what I needed to know. So I have to serialise requests? Uggg...

Er, no. Are we creating two instances of the same class? Or are we registering two different components for the same contractid? The former should work just fine. The latter will result in the later of the two being registered.


-Boris

Yes, creating two instances of the same class; so in each instance it performs the same code, i.e createInstance(...) as I have above.
How do you register two different components for the same contractid? Is that by using two different interfaces? Sorry, I'm a bit of an XPCOM noobie, I thought I understood how it hung together but maybe I'm missing something.
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to