Issue #2672 - Part 1: Load nsCookieService OMT and use sync reads.

No more lazy-loading on the main thread, thanks. Everyone needs this.
This commit is contained in:
Moonchild 2024-12-22 15:55:22 +01:00 committed by roytam1
commit aec27853c6
3 changed files with 426 additions and 568 deletions

View file

@ -1437,6 +1437,11 @@ nsIOService::Observe(nsISupports *subject,
nsCOMPtr<nsIPrefBranch> prefBranch;
GetPrefBranch(getter_AddRefs(prefBranch));
PrefsChanged(prefBranch, MANAGE_OFFLINE_STATUS_PREF);
// Issue #2672 - Read cookie database at an early-as-possible time
// off main thread. Hence, we have more chance to finish db query
// before something calls into the cookie service.
nsCOMPtr<nsISupports> cookieServ = do_GetService(NS_COOKIESERVICE_CONTRACTID);
}
} else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
// Remember we passed XPCOM shutdown notification to prevent any