Closed Bug 1658230 Opened 2 years ago Closed 2 years ago

Deduplicate ProfileJSONWriter


(Core :: Gecko Profiler, task, P2)




81 Branch
Tracking Status
firefox81 --- fixed


(Reporter: gerald, Assigned: gerald)


(Blocks 1 open bug)



(3 files)

We have both "BaseProfileJSONWriter.h" and "ProfileJSONWriter.h" that contain the same code.

Blocks: 1658232

Because this header will be used across libraries, it is simpler to make it fully self-contained instead of using MFBT_API.

The main change is removing ProfileJSONWriter.cpp, making ProfileJSONWriter.h point at BaseProfileJSONWriter.h, and exposing mozilla::baseprofiler:: classes in the top namespace as expected by users of ProfileJSONWriter.h (to minimize changes).

These two headers are now always present in the "mozilla" include directory, independent of MOZ_GECKO_PROFILER settings.

The rest is just needed tweaks to match the above changes.

Depends on D86503

SpliceableChunkedJSONWriter::WriteFunc was hiding base-class non-virtual JSONWriter::WriteFunc(), which made it less than ideal (for me) to reason with.

Also made SpliceableChunkedJSONWriter final, to help with possible devirtualization.

Depends on D86504

Pushed by
Make BaseProfileJSONWriter.h header-only - r=gregtatum
Deduplicate ProfileJSONWriter classes - r=gregtatum
Renamed SpliceableChunkedJSONWriter::WriteFunc to ChunkedWriteFunc - r=gregtatum
You need to log in before you can comment on or make changes to this bug.