fix: misc-use-internal-linkage warnings (#44872)

* refactor: fix misc-use-internal-linkage warnings:

move impl functions into anonymous namespace so that they're not visible
to other compilation units
This commit is contained in:
trop[bot] 2024-11-27 12:35:37 -06:00 committed by GitHub
parent 5ca3f950e9
commit a92b3944a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 54 additions and 14 deletions

View file

@ -70,6 +70,8 @@ Menu::~Menu() {
}
}
namespace {
bool InvokeBoolMethod(const Menu* menu,
const char* method,
int command_id,
@ -84,6 +86,8 @@ bool InvokeBoolMethod(const Menu* menu,
return gin::ConvertFromV8(isolate, val, &ret) ? ret : default_value;
}
} // namespace
bool Menu::IsCommandIdChecked(int command_id) const {
return InvokeBoolMethod(this, "_isCommandIdChecked", command_id);
}

View file

@ -44,6 +44,8 @@
namespace electron {
namespace {
base::IDMap<api::UtilityProcessWrapper*, base::ProcessId>&
GetAllUtilityProcessWrappers() {
static base::NoDestructor<
@ -52,6 +54,8 @@ GetAllUtilityProcessWrappers() {
return *s_all_utility_process_wrappers;
}
} // namespace
namespace api {
gin::WrapperInfo UtilityProcessWrapper::kWrapperInfo = {

View file

@ -100,6 +100,8 @@ using FrameTreeNodeIdMap = std::unordered_map<content::FrameTreeNodeId,
using FrameTokenMap =
std::map<content::GlobalRenderFrameHostToken, WebFrameMain*>;
namespace {
FrameTreeNodeIdMap& GetFrameTreeNodeIdMap() {
static base::NoDestructor<FrameTreeNodeIdMap> instance;
return *instance;
@ -109,6 +111,8 @@ FrameTokenMap& GetFrameTokenMap() {
return *instance;
}
} // namespace
// static
WebFrameMain* WebFrameMain::FromFrameTreeNodeId(
content::FrameTreeNodeId frame_tree_node_id) {