Bug 1693101 - Codegen.py should only include ProfilerLabels.h when a profiler label will be generated, r=sg,peterv

Differential Revision: https://phabricator.services.mozilla.com/D105341
This commit is contained in:
Florian Quèze 2021-02-23 17:52:18 +00:00
Родитель f4c23eed3e
Коммит b1c34e19a3
1 изменённых файлов: 17 добавлений и 2 удалений

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

@ -18022,8 +18022,23 @@ class CGBindingRoot(CGThing):
for d in descriptors
)
# XXX Not sure when we actually need this
bindingHeaders["GeckoProfiler.h"] = True
# The conditions for which we generate profiler labels are fairly
# complicated. The check below is a little imprecise to make it simple.
# It includes the profiler header in all cases where it is necessary and
# generates only a few false positives.
bindingHeaders["mozilla/ProfilerLabels.h"] = any(
# constructor profiler label
d.interface.namedConstructors
or (d.interface.hasInterfaceObject() and d.interface.ctor())
or any(
# getter/setter profiler labels
m.isAttr()
# method profiler label
or m.isMethod()
for m in d.interface.members
)
for d in descriptors
)
def descriptorHasCrossOriginProperties(desc):
def hasCrossOriginProperty(m):