Is there an ultimate conclusion to this discussion? We would like to
know whether we should begin migrating our XPCOM component (which
makes use of no non-trivial XPCOM interfaces besides our own, but has
a somewhat complex OO API) to js-ctypes, or if we should stick it out
with the expectation that we'll eventually be able to target multiple
releases with an XPCOM component again.
Thanks,
Simon
On Jan 19, 10:22 pm, Bobby Holley <
bobbyhol...@gmail.com> wrote:
> On Thu, Jan 19, 2012 at 6:24 PM, Zack Weinberg <
za...@panix.com> wrote:
> > Hmm, would this preclude switching to a more efficient QueryInterface
> > implementation, as bsmedberg said upthread might be possible if we didn't
> > have to maintain IIDs?
>
> I'm not positive, but at first glance I don't see it as a significant
> problem.
>
> First there's the C++ case: If extensions aren't touching gecko from native
> code, then we don't need any sort of IID mechanism to ensure that they get
> the component they expect (because they're not getting _any_ components).
> They can just use whatever new nsISupports we come up with, so the only
> thing that will require version checking is nsISupports itself (along with
> any trivial helpers like nsIArray). This can be accomplished by a simple
> XPCOM versioning scheme, where we rev to an incompatible version if we ever
> really need to change nsISupports.
>
> Now, for the JS case, extension code would indeed be accessing gecko
> interfaces. But thankfully, that JS code runs using whatever version of
> XPConnect shipped with the given release, so it would automatically get the
> right behavior. It would still throw if it tried to use a method whose
> signature was changed in an incompatible way, but this is true for any
> extension (and throwing a JS exception is much better than crashing).
>
> This is all sort of academic though, because I think that getting rid of
> IIDs is a mammoth task, and unlikely to happen any time soon. According to
> grep, there are 795 lines containing the string "iid" in XPConnect alone,
> so you're in for a real treat if you try to remove them entirely. Perhaps a
> better strategy for experimentation would be to just make IIDs 64 bits?
> This would be less invasive, and probably just require changing a dozen or
> so hard-coded constants. You'd be unlikely to run into collisions with a
> single m-c snapshot, and it'd give us an idea of the performance overhead
> of IID comparisons.
>
> bholley