Philip Langdale wrote:
> Hi all,
>
> Been meaning to ask this one for a while.
>
> Not sure whether I've described it correctly in the title, so I'll try and
> provide an example.
>
> Say we have mozilla-the-browser and a download manager. The download
> manager wants to dynamically register nsIContentHandlers for different
> mime types that it wants to handle while the browser is running. Is this
> possible?
To answer your Subject: line: no. There is no real shared-memory or
cross-process marshalling support in XPCOM, though it wouldn't be unwelcome.
But your scenario is a little different, I think: if I understand
correctly, you want the download manager to register a component when it
starts up, and unregister the component when it shuts down -- except
that it wants another process to do the registering and unregistering!
We certainly have some of the pieces in place; XPCOM can handle
(un)registration of new components at just about any time, and we have
various ways (X-Remote, DDE, etc.) to instruct the browser to Do
Something. You might be able to pull it all off by using X-Remote to
instruct the browser to visit a privileged JS document, which would then
do all your registration magic. On shutdown, the download manager would
send the browser to another URL, this time to unregister the handlers.
I realize that's vague, but I hope it's enough to get you started.
Mike