On Fri, Sep 20, 2013 at 09:06:41AM -0400, Benjamin Smedberg wrote:
> Currently, extensions are able to use the JSAPI via its exported
> symbols. This pretty much invariably leads to stability or security
> issues with extensions that actually do this:
> 
> * the JSAPI is complicated, and even within Mozilla we get reviews
> from a select set of people on JSAPI code
> * the JSAPI is moving quickly for such features as exact rooting as
> well as things like compartments and the interaction with xpconnect.
> Extensions aren't keeping up.
> * the JSAPI is not a binary-stable interface but some people are
> trying to use it that way
> 
> So I would like to propose that we link the JS libraries statically
> into libxul and stop exporting JSAPI symbols entirely. This will
> effectively prevent extensions from using it.
> 
> There are some technical issues to work out, such as what we do with
> xpcshell. I think what I'd like to do is bake xpcshell directly into
> libxul. As a side benefit this will aid a long-term goal of mine to
> unify the startup paths across app/embedding/xpcshell launch.
> 
> Thoughts or objections?

We're already statically linking js libraries info libxul. Except on
windows, but that's work in progress in bug 915735, although we don't
know yet if it's going to work at all: after dealing with the xpcshell
crash during the instrumentation phase, we'll have to see how much
memory the linker is going to use, and that might not be very good news
ahead.

Not exporting jsapi should be trivial, once we're there.

For xpcshell, I think there's a bug around to essentially fold it into
libxul, except for a thin layer. Ted might have been the one to file it
a long time ago.

With that being said, relatedly, while I'm hopeful we could kill the
--enable-shared-js option (for libxul) at some point, Boris raised an
interesting point in that it is useful to him with Instruments, so that
it can flatten everything from libmozjs in a profile. I hope we'll find
an alternative for him, because I wouldn't like to make things painful
for Boris. OTOH, supporting --enable-shared-js is already causing
headaches, not exporting symbols might add to the complexity.

Mike
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to