Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[linux-distros-dev] Re: SWT: NS_InitEmbedding vs. NS_InitXPCOM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Overholt wrote:
> Hi,
> 
> I've been working on this bug for the past few days but I seem to be getting
> nowhere:
> 
>   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201778
> 
> The bug is caused because upstream SWT makes use of symbols that are in the
> statically-linked firefox builds but not in our (Fedora) dynamically-linked
> builds.  Below I outline the situation and detail attempts I have made to fix
> it.

Embedding static builds (which is the default configuration of Firefox) is
not supported and I can't believe it ever worked.

> I have read a lot of documentation on XPCOM and embedding, but all of it
> seems to say you must use NS_InitEmbedding.  Chris Aillon suggested I use

NS_InitEmbedding is a method that is part of a static library called
embed_base_s. It is meant to be linked directly into embedded applications.
As I understand it, "make install" doesn't install this library anywhere and
so the Linux distros have never shipped it. NS_InitEmbedding has been
replaced with the dynamically-linked (and much more capable)
XRE_InitEmbedding API in XULRunner. We are really pushing XULRunner as the
accepted and tested way to embed Mozilla technologies, and it even has Java
embedding APIs builtin (e.g. ATF is using it entirely from Java).

> NS_InitXPCOM3 (or 2) instead.  That seemed to solve the issue of building and
> basic usage but then we ran into the problem of sites that request the
> passwordmanager not working ([1] below).  Also, https sites do not work ([2]
> below).  Note that SWT is written in Java so there is some JNI involved.

That sounds like you do not have a profile directory. You must have a
profile directory in order for certain things to work correctly (which
probably includes passwordmanager and SSL).

> I would greatly appreciate any pointers to docs or even better some guidance
> as to what we can do to fix this.  Ideally, SWT would be able to work with
> both older Mozilla releases (1.4, 1.7), Firefox downloads, *and* xulrunner.

That is impractical. Although the Windows GRE worked as early as Mozilla
1.4, the Linux GRE has always been a mess because Linux compilers by default
export private symbols, and using frozen linkage has been mostly impossible.
We have finally fixed things up for XULRunner so that using frozen linkage
on Linux (and Mac!) is now not only possible, but works reasonably well.

- --BDS

Please post any followups to mozilla.dev.embedding newsgroup so that we can
continue the discussion in public.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFG+ZlSSwGp5sTYNkRAgR+AJ9zG/cMXUj5Iyua5YQzPJRQ3wtu9ACfbAIq
oGvt3BPHcOYVjiTeL3k4Chc=
=kar1
-----END PGP SIGNATURE-----


Back to the top