Julien Pierre wrote:
Brian,

Brian Ryner wrote:
I'll do some profiling to make sure it's the DB initialization that's causing the performance hit.

I guess maybe I should have mentioned that I'm currently using these methods through the nsICryptoHash XPCOM wrapper. So we'd either need to change that object to know that it can do a NoDB_Init if full initialization hasn't happened yet, or I could switch over to using the NSS functions directly. Are there any problems with a Firefox extension linking directly to NSS?

There should be no problem linking to NSS in a Firefox extension, but you definitely want to let the browser/PSM do the NSS initialization,

The problem I see is that PSM no longer has control over the resources in possession by that extension, and PSM will no longer be able to delay NSS shutdown/re-init when a profile switch is attempted.

As you must wait until PSM has completed it's init, calling NSS functions after that time doesn't give him the advantage he is looking for, so he should preferably stick to the PSM layer, IMHO.

as opposed to your own code. If you call NSS_NoDB_Init before PSM initializes NSS, then no NSS databases will be available to Firefox, eg. all SSL connections will fail due to the lack of trusted CA certs.

I can't help you with which PSM functions you need to call to ensure that PSM is initialized unfortunately, but Kai Engert should know the answer.

PSM will get initialized automatically at the time the first PSM's XPCOM instance is being constructed / accessed.

Kai
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to