diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-22 11:26:15 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-22 11:26:40 +0100 |
commit | bb7d6fb310ba90bb5604d9e274f2e9e835e9abcf (patch) | |
tree | ec19753f97d308ab0d6cbf6c2e8034eea0fbf1db /DevTools/ProfileViewer/Profile.cpp | |
parent | 34b81f17c2f078b180b000878f6f1c82fb7c397e (diff) | |
download | serenity-bb7d6fb310ba90bb5604d9e274f2e9e835e9abcf.zip |
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.
Diffstat (limited to 'DevTools/ProfileViewer/Profile.cpp')
-rw-r--r-- | DevTools/ProfileViewer/Profile.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/DevTools/ProfileViewer/Profile.cpp b/DevTools/ProfileViewer/Profile.cpp index c9f2b27cdc..95182cd648 100644 --- a/DevTools/ProfileViewer/Profile.cpp +++ b/DevTools/ProfileViewer/Profile.cpp @@ -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); |