mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
test: fix pseudonymization registration in utility process on Linux
Ref: 7486913: Pass pseudonymization salt via shared memory at process launch | https://chromium-review.googlesource.com/c/chromium/src/+/7486913
This commit is contained in:
@@ -66,6 +66,8 @@
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "base/posix/global_descriptors.h"
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "v8/include/v8-wasm-trap-handler-posix.h"
|
||||
#include "v8/include/v8.h"
|
||||
#endif
|
||||
@@ -240,6 +242,18 @@ void ElectronMainDelegate::PreSandboxStartup() {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
std::string process_type = GetProcessType();
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Register the pseudonymization salt descriptor in GlobalDescriptors.
|
||||
// (see https://crbug.com/40850085) Only affects processes launched
|
||||
// without the zygote (i.e. utility processes)
|
||||
if (!process_type.empty() && !IsZygoteProcess()) {
|
||||
base::GlobalDescriptors::GetInstance()->Set(
|
||||
kPseudonymizationSaltDescriptor,
|
||||
kPseudonymizationSaltDescriptor +
|
||||
base::GlobalDescriptors::kBaseDescriptor);
|
||||
}
|
||||
#endif
|
||||
|
||||
base::FilePath user_data_dir =
|
||||
command_line->GetSwitchValuePath(::switches::kUserDataDir);
|
||||
if (!user_data_dir.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user