Loading libprocessgroup/task_profiles.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -786,7 +786,7 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) { return true; } TaskProfile* TaskProfiles::GetProfile(const std::string& name) const { TaskProfile* TaskProfiles::GetProfile(std::string_view name) const { auto iter = profiles_.find(name); if (iter != profiles_.end()) { Loading @@ -795,7 +795,7 @@ TaskProfile* TaskProfiles::GetProfile(const std::string& name) const { return nullptr; } const IProfileAttribute* TaskProfiles::GetAttribute(const std::string& name) const { const IProfileAttribute* TaskProfiles::GetAttribute(std::string_view name) const { auto iter = attributes_.find(name); if (iter != attributes_.end()) { Loading libprocessgroup/task_profiles.h +6 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <map> #include <mutex> #include <string> #include <string_view> #include <vector> #include <android-base/unique_fd.h> Loading Loading @@ -206,18 +207,18 @@ class TaskProfiles { // Should be used by all users static TaskProfiles& GetInstance(); TaskProfile* GetProfile(const std::string& name) const; const IProfileAttribute* GetAttribute(const std::string& name) const; TaskProfile* GetProfile(std::string_view name) const; const IProfileAttribute* GetAttribute(std::string_view name) const; void DropResourceCaching(ProfileAction::ResourceCacheType cache_type) const; bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles, bool use_fd_cache); bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache); private: std::map<std::string, std::shared_ptr<TaskProfile>> profiles_; std::map<std::string, std::unique_ptr<IProfileAttribute>> attributes_; TaskProfiles(); bool Load(const CgroupMap& cg_map, const std::string& file_name); std::map<std::string, std::shared_ptr<TaskProfile>, std::less<>> profiles_; std::map<std::string, std::unique_ptr<IProfileAttribute>, std::less<>> attributes_; }; Loading
libprocessgroup/task_profiles.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -786,7 +786,7 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) { return true; } TaskProfile* TaskProfiles::GetProfile(const std::string& name) const { TaskProfile* TaskProfiles::GetProfile(std::string_view name) const { auto iter = profiles_.find(name); if (iter != profiles_.end()) { Loading @@ -795,7 +795,7 @@ TaskProfile* TaskProfiles::GetProfile(const std::string& name) const { return nullptr; } const IProfileAttribute* TaskProfiles::GetAttribute(const std::string& name) const { const IProfileAttribute* TaskProfiles::GetAttribute(std::string_view name) const { auto iter = attributes_.find(name); if (iter != attributes_.end()) { Loading
libprocessgroup/task_profiles.h +6 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <map> #include <mutex> #include <string> #include <string_view> #include <vector> #include <android-base/unique_fd.h> Loading Loading @@ -206,18 +207,18 @@ class TaskProfiles { // Should be used by all users static TaskProfiles& GetInstance(); TaskProfile* GetProfile(const std::string& name) const; const IProfileAttribute* GetAttribute(const std::string& name) const; TaskProfile* GetProfile(std::string_view name) const; const IProfileAttribute* GetAttribute(std::string_view name) const; void DropResourceCaching(ProfileAction::ResourceCacheType cache_type) const; bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles, bool use_fd_cache); bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache); private: std::map<std::string, std::shared_ptr<TaskProfile>> profiles_; std::map<std::string, std::unique_ptr<IProfileAttribute>> attributes_; TaskProfiles(); bool Load(const CgroupMap& cg_map, const std::string& file_name); std::map<std::string, std::shared_ptr<TaskProfile>, std::less<>> profiles_; std::map<std::string, std::unique_ptr<IProfileAttribute>, std::less<>> attributes_; };