ProfileViewer: Remove loading code for the old file format

We're still jumping through all kinds of silly hoops to load the new
format, and this commit only gets rid of the API for loading old files.
This commit is contained in:
Andreas Kling 2020-02-22 11:26:15 +01:00
parent 34b81f17c2
commit bb7d6fb310
2 changed files with 0 additions and 22 deletions

View file

@ -272,27 +272,6 @@ OwnPtr<Profile> Profile::load_from_perfcore_file(const StringView& path)
return NonnullOwnPtr<Profile>(NonnullOwnPtr<Profile>::Adopt, *new Profile(move(profile_events)));
}
OwnPtr<Profile> Profile::load_from_file(const StringView& path)
{
auto file = Core::File::construct(path);
if (!file->open(Core::IODevice::ReadOnly)) {
fprintf(stderr, "Unable to open %s, error: %s\n", String(path).characters(), file->error_string());
return nullptr;
}
auto json = JsonValue::from_string(file->read_all());
if (!json.is_array()) {
fprintf(stderr, "Invalid format (not a JSON array)\n");
return nullptr;
}
auto& samples = json.as_array();
if (samples.is_empty())
return nullptr;
return NonnullOwnPtr<Profile>(NonnullOwnPtr<Profile>::Adopt, *new Profile(move(samples)));
}
void ProfileNode::sort_children()
{
sort_profile_nodes(m_children);

View file

@ -101,7 +101,6 @@ private:
class Profile {
public:
static OwnPtr<Profile> load_from_file(const StringView& path);
static OwnPtr<Profile> load_from_perfcore_file(const StringView& path);
~Profile();