From bb7d6fb310ba90bb5604d9e274f2e9e835e9abcf Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 22 Feb 2020 11:26:15 +0100 Subject: [PATCH] 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. --- DevTools/ProfileViewer/Profile.cpp | 21 --------------------- DevTools/ProfileViewer/Profile.h | 1 - 2 files changed, 22 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::load_from_perfcore_file(const StringView& path) return NonnullOwnPtr(NonnullOwnPtr::Adopt, *new Profile(move(profile_events))); } -OwnPtr 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(NonnullOwnPtr::Adopt, *new Profile(move(samples))); -} - void ProfileNode::sort_children() { sort_profile_nodes(m_children); diff --git a/DevTools/ProfileViewer/Profile.h b/DevTools/ProfileViewer/Profile.h index b195b771b7..de9cda3c74 100644 --- a/DevTools/ProfileViewer/Profile.h +++ b/DevTools/ProfileViewer/Profile.h @@ -101,7 +101,6 @@ private: class Profile { public: - static OwnPtr load_from_file(const StringView& path); static OwnPtr load_from_perfcore_file(const StringView& path); ~Profile();