Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
index 2bdec2b0c672f1b31af9f506c50c0cf41e357dec..2be9156d6979d99053c03623c1516a504082d284 100644 |
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
@@ -22,6 +22,7 @@ |
#include "build/build_config.h" |
#include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h" |
#include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" |
+#include "content/common/set_process_title.h" |
#include "content/public/common/content_switches.h" |
#include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" |
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
@@ -136,7 +137,22 @@ ErrorCode GpuBrokerProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox, |
} |
} |
+static void UpdateProcessTitle() { |
jln (very slow on Chromium)
2014/02/20 00:29:57
UpdateProcessTypeToGpuBroker() instead?
dshwang
2014/02/20 20:36:31
Done
|
+ CommandLine::StringVector exec = CommandLine::ForCurrentProcess()->GetArgs(); |
+ CommandLine::Reset(); |
+ CommandLine::Init(0, NULL); |
+ CommandLine::ForCurrentProcess()->InitFromArgv(exec); |
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kProcessType, |
+ "gpu-broker"); |
+ |
+ // Update the process title. The argv was already cached by the call to |
+ // SetProcessTitleFromCommandLine in content_main_runner.cc, so we can pass |
Jorge Lucangeli Obes
2014/02/20 00:33:05
Is this comment still accurate?
dshwang
2014/02/20 20:36:31
Yes. but there is some logic jump. Browser process
|
+ // NULL here (we don't have the original argv at this point). |
+ SetProcessTitleFromCommandLine(NULL); |
+} |
+ |
bool EnableGpuBrokerPolicyCallback() { |
jln (very slow on Chromium)
2014/02/20 00:29:57
Let's rename to GpuBrokerChildInitCallback or some
dshwang
2014/02/20 20:36:31
Done
|
+ UpdateProcessTitle(); |
return SandboxSeccompBPF::StartSandboxWithExternalPolicy( |
scoped_ptr<sandbox::SandboxBPFPolicy>(new GpuBrokerProcessPolicy)); |
} |