Looking at a few of the crash reports, the last sanitization progress step is 'principals-quota-manager', so [Services.qms.listOrigins()](https://searchfox.org/mozilla-central/rev/6f9fdc5c3b164a46004c98a5baaf55b05e2ad329/toolkit/components/cleardata/PrincipalsCollector.jsm#96) could be causing this. I noticed that we can reduce our calls to getAllPrincipals() in the sanitizer, we should try to only call this if sanitizeOnShutdown, clearOnShutdown.cookies and clearOnShutdown.offlineApps are true or the user has session permissions exceptions. - If sanitizeOnShutdown is true, we can check if offlineApps or cookies are to be cleaned, otherwise we can skip the call to getAllPrincipals() because those are the only categories we clear per principal. - If sanitizeOnShutdown is true I think we can also skip this ['session-permissions'](https://searchfox.org/mozilla-central/rev/6f9fdc5c3b164a46004c98a5baaf55b05e2ad329/browser/modules/Sanitizer.jsm#860) block that is calling getAllPrincipals() again, from my understanding the session permission origins should already be cleared if sanitizeOnshutdown is true. - Before we go through the session-permissions block we should try and check if the user even has session-permissions set, otherwise we could skip this. Paul, any thoughts on this?
Bug 1578273 Comment 13 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Looking at a few of the crash reports, the last sanitization progress step is 'principals-quota-manager', so [Services.qms.listOrigins()](https://searchfox.org/mozilla-central/rev/6f9fdc5c3b164a46004c98a5baaf55b05e2ad329/toolkit/components/cleardata/PrincipalsCollector.jsm#96) could be causing this. I noticed that we can reduce our calls to getAllPrincipals() in the sanitizer, we should try to only call this if sanitizeOnShutdown, clearOnShutdown.cookies and clearOnShutdown.offlineApps are true or the user has session permissions exceptions. - If sanitizeOnShutdown is true, we can check if offlineApps or cookies are to be cleaned, otherwise we can skip the call to getAllPrincipals() because those are the only categories we clear per principal. - If sanitizeOnShutdown is true I think we can also skip this ['session-permissions'](https://searchfox.org/mozilla-central/rev/6f9fdc5c3b164a46004c98a5baaf55b05e2ad329/browser/modules/Sanitizer.jsm#860) block that is calling getAllPrincipals() again, from my understanding the session permission origins should already be cleared if sanitizeOnshutdown is true. Paul, any thoughts on this?