Allow CertNetFetcher to be shut down from the network thread
In order to be suitable for use from within CertVerifyProc, this CL makes CertNetFetcher shareable between the network and worker threads. The worker thread will start and wait for fetch requests, but the network thread needs to be able to create and shutdown the fetcher. Shutdown is needed to be able to destroy the URLRequestContext cleanly: since the CertNetFetcher will have a reference to the URLRequestContext, the network thread needs to be able to shut down the fetcher and cancel outstanding requests before destroying the URLRequestContext. Thus this CL makes CertNetFetcher refcounted (replacing its refcounted bridge class CertNetFetcherCore) and gives it a Shutdown method to cancel its outstanding requests and prevent new ones from starting. Note that there is still a race where a worker thread could issue a fetch request while the network thread is shutting down. In this case, the fetch task would never run on the network thread and WaitForResult would hang indefinitely. I'm not sure what to do about this except give WaitForResult() a timeout like nss_ocsp does. BUG=657549 Review-Url: https://codereview.chromium.org/2595723002 Cr-Commit-Position: refs/heads/master@{#443490}
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment