| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gpu_process_host.h" | 5 #include "chrome/browser/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 | 457 |
| 458 void GpuProcessHost::OnChildDied() { | 458 void GpuProcessHost::OnChildDied() { |
| 459 // Located in OnChildDied because OnProcessCrashed suffers from a race | 459 // Located in OnChildDied because OnProcessCrashed suffers from a race |
| 460 // condition on Linux. The GPU process will only die if it crashes. | 460 // condition on Linux. The GPU process will only die if it crashes. |
| 461 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", | 461 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", |
| 462 kCrashed, kGPUProcessLifetimeEvent_Max); | 462 kCrashed, kGPUProcessLifetimeEvent_Max); |
| 463 BrowserChildProcessHost::OnChildDied(); | 463 BrowserChildProcessHost::OnChildDied(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void GpuProcessHost::OnProcessCrashed() { | 466 void GpuProcessHost::OnProcessCrashed(int exit_code) { |
| 467 // TODO(alokp): Update gpu process crash rate. | 467 // TODO(alokp): Update gpu process crash rate. |
| 468 BrowserChildProcessHost::OnProcessCrashed(); | 468 BrowserChildProcessHost::OnProcessCrashed(exit_code); |
| 469 } | 469 } |
| 470 | 470 |
| 471 bool GpuProcessHost::CanLaunchGpuProcess() const { | 471 bool GpuProcessHost::CanLaunchGpuProcess() const { |
| 472 // TODO(alokp): Answer based on crash rate. | 472 // TODO(alokp): Answer based on crash rate. |
| 473 return true; | 473 return true; |
| 474 } | 474 } |
| 475 | 475 |
| 476 bool GpuProcessHost::LaunchGpuProcess() { | 476 bool GpuProcessHost::LaunchGpuProcess() { |
| 477 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 477 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 478 CommandLine::StringType gpu_launcher = | 478 CommandLine::StringType gpu_launcher = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 #elif defined(OS_POSIX) | 510 #elif defined(OS_POSIX) |
| 511 false, // Never use the zygote (GPU plugin can't be sandboxed). | 511 false, // Never use the zygote (GPU plugin can't be sandboxed). |
| 512 base::environment_vector(), | 512 base::environment_vector(), |
| 513 #endif | 513 #endif |
| 514 cmd_line); | 514 cmd_line); |
| 515 | 515 |
| 516 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", | 516 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", |
| 517 kLaunched, kGPUProcessLifetimeEvent_Max); | 517 kLaunched, kGPUProcessLifetimeEvent_Max); |
| 518 return true; | 518 return true; |
| 519 } | 519 } |
| 520 | |
| OLD | NEW |