From 9d03b260f0b6bc05317d044767854926b1a02c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Mon, 16 Sep 2024 21:09:33 +0000 Subject: [PATCH] Bug 1634785 - Do not expose AddSharedLibraryFromModuleInfo that's only used internally r=mstange,profiler-reviewers This method was used only internally, and having this method declaration causes issues. That's this method was already like this in tools/profiler version of this but it wasn't implemented here. Differential Revision: https://phabricator.services.mozilla.com/D220886 --- mozglue/baseprofiler/core/shared-libraries-win32.cc | 13 +++++++------ .../public/BaseProfilerSharedLibraries.h | 5 ----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/mozglue/baseprofiler/core/shared-libraries-win32.cc b/mozglue/baseprofiler/core/shared-libraries-win32.cc index fc92914101f2..b6faf49cd746 100644 --- a/mozglue/baseprofiler/core/shared-libraries-win32.cc +++ b/mozglue/baseprofiler/core/shared-libraries-win32.cc @@ -73,8 +73,9 @@ static bool IsModuleUnsafeToLoad(const std::string& aModuleName) { return false; } -void SharedLibraryInfo::AddSharedLibraryFromModuleInfo( - const wchar_t* aModulePath, mozilla::Maybe aModule) { +void AddSharedLibraryFromModuleInfo(SharedLibraryInfo& sharedLibraryInfo, + const wchar_t* aModulePath, + mozilla::Maybe aModule) { mozilla::UniquePtr utf8ModulePath( mozilla::glue::WideToUTF8(aModulePath)); if (!utf8ModulePath) { @@ -172,7 +173,7 @@ void SharedLibraryInfo::AddSharedLibraryFromModuleInfo( 0, // DLLs are always mapped at offset 0 on Windows breakpadId, codeId, moduleNameStr, modulePathStr, pdbNameStr, pdbPathStr, versionStr, ""); - AddSharedLibrary(shlib); + sharedLibraryInfo.AddSharedLibrary(shlib); } SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { @@ -180,8 +181,8 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { auto addSharedLibraryFromModuleInfo = [&sharedLibraryInfo](const wchar_t* aModulePath, HMODULE aModule) { - sharedLibraryInfo.AddSharedLibraryFromModuleInfo( - aModulePath, mozilla::Some(aModule)); + AddSharedLibraryFromModuleInfo(sharedLibraryInfo, aModulePath, + mozilla::Some(aModule)); }; mozilla::EnumerateProcessModules(addSharedLibraryFromModuleInfo); @@ -190,7 +191,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { SharedLibraryInfo SharedLibraryInfo::GetInfoFromPath(const wchar_t* aPath) { SharedLibraryInfo sharedLibraryInfo; - sharedLibraryInfo.AddSharedLibraryFromModuleInfo(aPath, mozilla::Nothing()); + AddSharedLibraryFromModuleInfo(sharedLibraryInfo, aPath, mozilla::Nothing()); return sharedLibraryInfo; } diff --git a/mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h b/mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h index ac9ec4aa889d..7732718833ff 100644 --- a/mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h +++ b/mozglue/baseprofiler/public/BaseProfilerSharedLibraries.h @@ -177,11 +177,6 @@ class SharedLibraryInfo { } private: -#ifdef XP_WIN - void AddSharedLibraryFromModuleInfo(const wchar_t* aModulePath, - mozilla::Maybe aModule); -#endif - std::vector mEntries; };