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
This commit is contained in:
Riley Dulin
2019-10-31 14:48:01 -07:00
committed by Facebook Github Bot
parent 8c7ec51981
commit f91a21b2c0
3 changed files with 8 additions and 12 deletions
+4 -4
View File
@@ -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(
+2 -6
View File
@@ -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(
+2 -2
View File
@@ -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;
}