Closed Bug 1194787 Opened 9 years ago Closed 9 years ago

Add a way to do global markers that are TimelineMarker subclasses

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: fitzgen, Unassigned)

References

Details

This is the Nth rabbit hole I went down for bug 1191571 and console.time/timeEnd markers for chrome consoles where I hit my rabbit hole limit and gave up. Talking to tromey, we concluded that it is probably easier to create an instance per consumer (as the code does now for TimelineMarker not-subclass) rather than make TimelineMarker ref counted and deal with the cycle collector. Especially since the vast majority of the time there is only zero or one consumer. So, we need to create a TimelineMarker subclass instance for each consumer, but this process needs to be somewhat generic because each subclass might have different specifics. I suggest either a function taking a functor that creates the marker, or a lambda that creates the marker, or a templatized thing that accepts either of those two.
This is now supported. Filed bug 1211843 for updating the wiki, but in short: anyone can subclass TimelineMarkers (or even AbstractTimelineMarkers if you want to go lower level), since they don't depend on main thread constructs anymore. TimelineConsumers is now a singleton that is able to take these subclasses and spread them to all interested consumers.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Note: need to wait for bug 1202657 to land before the API stabilizes.
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.