Bug 1320289 - register STS thread to gecko profiler. r=cyu,mayhemer

MozReview-Commit-ID: IzDNHDYAgsT

--HG--
extra : rebase_source : a43785dafc6c78658f3474958fce03a084486ab5
This commit is contained in:
Shih-Chiang Chien 2016-11-25 18:07:06 +08:00
parent 7e3288c81a
commit 6b0c7e2ce1

View File

@ -824,6 +824,11 @@ nsSocketTransportService::MarkTheLastElementOfPendingQueue()
NS_IMETHODIMP
nsSocketTransportService::Run()
{
#ifdef MOZ_ENABLE_PROFILER_SPS
char stackBaseGuess; // Need to be the first variable of main loop function.
profiler_register_thread(PR_GetThreadName(PR_GetCurrentThread()), &stackBaseGuess);
#endif // MOZ_ENABLE_PROFILER_SPS
SOCKET_LOG(("STS thread init %d sockets\n", gMaxCount));
psm::InitializeSSLServerCertVerificationThreads();
@ -1004,6 +1009,11 @@ nsSocketTransportService::Run()
psm::StopSSLServerCertVerificationThreads();
SOCKET_LOG(("STS thread exit\n"));
#ifdef MOZ_ENABLE_PROFILER_SPS
profiler_unregister_thread();
#endif // MOZ_ENABLE_PROFILER_SPS
return NS_OK;
}