Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Unified Diff: content/common/sandbox_linux/bpf_gpu_policy_linux.cc

Issue 163433011: Clarify the process title of GPU broker process. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698