Closed Bug 795114 Opened 12 years ago Closed 12 years ago

Verify NSS/STS availability and respond to shutdown

Categories

(Core :: WebRTC: Signaling, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 799419

People

(Reporter: ekr, Unassigned)

Details

(Whiteboard: [WebRTC], [blocking-webrtc-])

PCImpl needs to verify NSS and STS availability on startup and then shut down the entire world when they become unavailable. 

bsmith writes:
 am going to finish one round of reviews of the *dtls* files today. I already posted part of the review.

It is difficult to understand how this code ensures that NSS and the STS are available at all times that they need to be available.

Especially, there is an unfortunate gap during shutdown where NSS is not available. The reason is that we are supposed to stop doing disk I/O at "profile change" which happens before XPCOM and other things are shut down, and the certificate-related parts of NSS have some implicit disk I/O done. In PSM, we have nsNSSShutdownObject to deal with this, which is extremely ugly. It seems like there should be a single object (an XPCOM service?) in WebRTC that implements nsNSSShutdownObject and then ensures that all WebRTC connections are closed and that no new ones will be open; that way, you can avoid implementing nsNSSShutdownObject anywhere else. Then, it is just a matter of making sure that that component does:

    nsCOMPtr<nsISupports> dummyUsedToEnsureNSSIsInitialized
      = do_GetService("@mozilla.org/psm;1", &rv);

during its initialization (or better, when it starts initializing its first connection).

It would be helpful to know if/where/how this is being handled.

And, I think similar consideration apply to the StreamTransportService, which becomes available/unavailable in a similar manner to PSM. Is that being handled? If so, how?
Whiteboard: [WebRTC], [blocking-webrtc-]
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.