refactor: move impl functions into private namespace (#43409)

* refactor: move into unnamed namespace: IsKillURL()

refactor: move into unnamed namespace: ResolvePossiblyRelativeURL()

refactor: move into unnamed namespace: AllowFileAccess()

refactor: move into unnamed namespace: PrepareURLForNavigation()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetMonitors()

refactor: move into unnamed namespace: GetEDIDProperty()

refactor: move into unnamed namespace: MonitorAtomIdToDisplayId()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetPermissionInfos() } refactor: move into unnamed namespace: GetPermissionAliases()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: OnOpenExternal()

refactor: move into unnamed namespace: HandleExternalProtocolInUI()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: BindMimeHandlerService()

refactor: move into unnamed namespace: BindBeforeUnloadControl()

refactor: move into unnamed namespace: BindBadgeServiceForServiceWorker()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetClientIdPath()

refactor: move into unnamed namespace: ReadClientId()

refactor: move into unnamed namespace: WriteClientId()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: HasExplicitLogFile()

refactor: move into unnamed namespace: DetermineLoggingDestination()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetArchiveCache()

refactor: move into unnamed namespace: GetArchiveCacheLock()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetParameters()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: GetDoomed()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move into unnamed namespace: EncodeToken()

refactor: move into unnamed namespace: PortInfoToValue()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-08-21 19:43:17 -05:00 committed by GitHub
parent 4c11b0d6c9
commit f68f7870bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 40 additions and 8 deletions

View file

@ -46,8 +46,6 @@ bool IsDirectoryCached(const base::FilePath& path) {
return is_directory_cache[path] = base::DirectoryExists(path);
}
} // namespace
ArchiveMap& GetArchiveCache() {
static base::NoDestructor<ArchiveMap> s_archive_map;
return *s_archive_map;
@ -58,6 +56,8 @@ base::Lock& GetArchiveCacheLock() {
return *lock;
}
} // namespace
std::shared_ptr<Archive> GetOrCreateAsarArchive(const base::FilePath& path) {
base::AutoLock auto_lock(GetArchiveCacheLock());
ArchiveMap& map = GetArchiveCache();

View file

@ -28,6 +28,7 @@
#include "shell/common/extensions/api/permission_features.h"
namespace extensions {
namespace {
constexpr APIPermissionInfo::InitInfo permissions_to_register[] = {
{mojom::APIPermissionID::kDevtools, "devtools",
@ -52,6 +53,7 @@ base::span<const Alias> GetPermissionAliases() {
return base::span<const Alias>();
}
} // namespace
} // namespace extensions
namespace electron {

View file

@ -11,10 +11,15 @@
namespace gin_helper {
namespace {
std::vector<CleanedUpAtExit*>& GetDoomed() {
static base::NoDestructor<std::vector<CleanedUpAtExit*>> doomed;
return *doomed;
}
} // namespace
CleanedUpAtExit::CleanedUpAtExit() {
GetDoomed().emplace_back(this);
}

View file

@ -42,6 +42,8 @@ base::FilePath GetLogFileName(const base::CommandLine& command_line) {
}
}
namespace {
bool HasExplicitLogFile(const base::CommandLine& command_line) {
std::string filename = command_line.GetSwitchValueASCII(switches::kLogFile);
if (filename.empty())
@ -96,6 +98,8 @@ LoggingDestination DetermineLoggingDestination(
return LOG_TO_SYSTEM_DEBUG_LOG | LOG_TO_STDERR;
}
} // namespace
void InitElectronLogging(const base::CommandLine& command_line,
bool is_preinit) {
const std::string process_type =