matchMarkerEmitterNames(), resolveMarkerEmitters() and
appendMarkerEmitterDirectivesToConfig(), on ChromeUtils next to
getOrCreateProfilerMarkerEmitter(), so that about:profiling can filter,
display and edit a configuration without a second implementation of the
grammar. There are two of it already, in C++ and in Java, and that is one
more than anybody wants to keep honest.
They are pure. Nothing here touches an emitter, the registry or the
profiler's state, so they work before anything has ever been recorded --
which matters, because the list of emitters starts empty and the
configuration still has to be editable -- and they are cheap enough to call
on every keystroke.
None of them throws. A text that cannot be read comes back as error, and
the useful part of it is position: the offset is what lets a UI point at
the mistake rather than describe it, and an exception would have to drop it.
That also suits functions called while somebody is typing, where a malformed
intermediate state is normal rather than exceptional.
Appending takes a batch, which makes a bulk edit atomic: one parse of the
configuration, and a mistake anywhere appends none of it, the same
whole-or-nothing rule the configuration itself follows. Escaping stays in
ToString(); no caller assembles a directive by hand, so no caller can get it
wrong.
MarkerEmitterAction spells the sigils out. WebIDL turns every
non-alphanumeric character of an enum value into _, so "+", "-" and "~"
would all have collided.