mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-08 17:09:41 +00:00
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:
parent
34b81f17c2
commit
bb7d6fb310
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue