Bug 1542854 - Make [System Principal] into a static atom. r=froydnj

Whenever chrome JS code leaks, we leak the dynamic atom "[System
Principal]". This causes an assertion, which hangs the browser in
stack walking code for multiple minutes on OSX. As a bandaid, make
this atom static so it won't leak.

My first instinct is that it would make sense to use this new atom
directly in SystemPrincipal, but atoms are represented internally as a
kind of nsAString, but principal code uses nsACStrings, so you end up
with an extra conversion from 16-bit to 8-bit.

This atom is also going to be present in any process running chrome
JS, so this will save a little bit of memory.

Differential Revision: https://phabricator.services.mozilla.com/D26590

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-04-09 13:23:28 +00:00
Родитель cae12ea4a3
Коммит 648311b759
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -28,6 +28,7 @@ STATIC_ATOMS = [
# Generic atoms
# --------------------------------------------------------------------------
Atom("SystemPrincipal", "[System Principal]"),
Atom("_empty", ""),
Atom("_0", "0"),
Atom("_1", "1"),