From f91a21b2c0d7e31ed925c0bc283f48b176a4592c Mon Sep 17 00:00:00 2001 From: Riley Dulin Date: Thu, 31 Oct 2019 14:45:40 -0700 Subject: [PATCH] Remove compact parameter from heap snapshots Summary: This parameter used to be useful for a custom format hermes was developing, but since Hermes now outputs the Chrome format it isn't useful. Chrome actually disallows prettified JSON, and requires a special version that is faster to parse. Therefore, `compact` was the only supported mode. Changelog: [Internal] Remove compact parameter from `createSnapshotToFile` Reviewed By: willholen Differential Revision: D17726742 fbshipit-source-id: 6f39af9046dff2f3b4fba822312a9a89c939ed89 --- ReactCommon/jsi/jsi/decorator.h | 8 ++++---- ReactCommon/jsi/jsi/instrumentation.h | 8 ++------ ReactCommon/jsi/jsi/jsi.cpp | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ReactCommon/jsi/jsi/decorator.h b/ReactCommon/jsi/jsi/decorator.h index 828be448108..9616d19c7e5 100644 --- a/ReactCommon/jsi/jsi/decorator.h +++ b/ReactCommon/jsi/jsi/decorator.h @@ -335,12 +335,12 @@ class RuntimeDecorator : public Base, private jsi::Instrumentation { plain().instrumentation().collectGarbage(); } - bool createSnapshotToFile(const std::string& path, bool compact) override { - return plain().instrumentation().createSnapshotToFile(path, compact); + bool createSnapshotToFile(const std::string& path) override { + return plain().instrumentation().createSnapshotToFile(path); } - bool createSnapshotToStream(std::ostream& os, bool compact) override { - return plain().instrumentation().createSnapshotToStream(os, compact); + bool createSnapshotToStream(std::ostream& os) override { + return plain().instrumentation().createSnapshotToStream(os); } void writeBridgeTrafficTraceToFile( diff --git a/ReactCommon/jsi/jsi/instrumentation.h b/ReactCommon/jsi/jsi/instrumentation.h index 108c7eb7c84..3de9bce1c79 100644 --- a/ReactCommon/jsi/jsi/instrumentation.h +++ b/ReactCommon/jsi/jsi/instrumentation.h @@ -56,19 +56,15 @@ class Instrumentation { /// /// \param path to save the heap capture /// - /// \param compact Whether the JSON should be compact or pretty - /// /// \return true iff the heap capture succeeded - virtual bool createSnapshotToFile(const std::string& path, bool compact) = 0; + virtual bool createSnapshotToFile(const std::string& path) = 0; /// Captures the heap to an output stream /// /// \param os output stream to write to. /// - /// \param compact Whether the JSON should be compact or pretty - /// /// \return true iff the heap capture succeeded. - virtual bool createSnapshotToStream(std::ostream& os, bool compact) = 0; + virtual bool createSnapshotToStream(std::ostream& os) = 0; /// Write a trace of bridge traffic to the given file name. virtual void writeBridgeTrafficTraceToFile( diff --git a/ReactCommon/jsi/jsi/jsi.cpp b/ReactCommon/jsi/jsi/jsi.cpp index 88b653291a5..065589a4214 100644 --- a/ReactCommon/jsi/jsi/jsi.cpp +++ b/ReactCommon/jsi/jsi/jsi.cpp @@ -78,11 +78,11 @@ Instrumentation& Runtime::instrumentation() { void collectGarbage() override {} - bool createSnapshotToFile(const std::string&, bool) override { + bool createSnapshotToFile(const std::string&) override { return false; } - bool createSnapshotToStream(std::ostream&, bool) override { + bool createSnapshotToStream(std::ostream&) override { return false; }