| Index: content/browser/gpu/gpu_process_host.cc
|
| ===================================================================
|
| --- content/browser/gpu/gpu_process_host.cc (revision 118516)
|
| +++ content/browser/gpu/gpu_process_host.cc (working copy)
|
| @@ -200,6 +200,9 @@
|
| !it.IsAtEnd(); it.Advance()) {
|
| GpuProcessHost *host = it.GetCurrentValue();
|
|
|
| + if (host->sandboxed() != (client_id != 0))
|
| + continue;
|
| +
|
| if (HostIsValid(host))
|
| return host;
|
| }
|
| @@ -214,7 +217,7 @@
|
| cause,
|
| content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM);
|
|
|
| - GpuProcessHost* host = new GpuProcessHost(host_id);
|
| + GpuProcessHost* host = new GpuProcessHost(host_id, client_id != 0);
|
| if (host->Init())
|
| return host;
|
|
|
| @@ -246,11 +249,12 @@
|
| return NULL;
|
| }
|
|
|
| -GpuProcessHost::GpuProcessHost(int host_id)
|
| +GpuProcessHost::GpuProcessHost(int host_id, bool sandboxed)
|
| : host_id_(host_id),
|
| gpu_process_(base::kNullProcessHandle),
|
| in_process_(false),
|
| - software_rendering_(false) {
|
| + software_rendering_(false),
|
| + sandboxed_(sandboxed) {
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
|
| CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU))
|
| in_process_ = true;
|
| @@ -518,6 +522,10 @@
|
| return software_rendering_;
|
| }
|
|
|
| +bool GpuProcessHost::sandboxed() {
|
| + return sandboxed_;
|
| +}
|
| +
|
| void GpuProcessHost::ForceShutdown() {
|
| g_hosts_by_id.Pointer()->Remove(host_id_);
|
| process_->ForceShutdown();
|
| @@ -550,6 +558,9 @@
|
| cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
|
| cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
|
|
|
| + if (!sandboxed_)
|
| + cmd_line->AppendSwitch(switches::kDisableGpuSandbox);
|
| +
|
| // Propagate relevant command line switches.
|
| static const char* const kSwitchNames[] = {
|
| switches::kDisableBreakpad,
|
|
|