Closed Bug 1658230 Opened 6 months ago Closed 6 months ago

Deduplicate ProfileJSONWriter

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: gerald, Assigned: gerald)

References

(Blocks 1 open bug)

Details

Attachments

(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 gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/801e1d8c1de0
Make BaseProfileJSONWriter.h header-only - r=gregtatum
https://hg.mozilla.org/integration/autoland/rev/7ae81a4ff37e
Deduplicate ProfileJSONWriter classes - r=gregtatum
https://hg.mozilla.org/integration/autoland/rev/61871a38eb0f
Renamed SpliceableChunkedJSONWriter::WriteFunc to ChunkedWriteFunc - r=gregtatum
You need to log in before you can comment on or make changes to this bug.