OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 GpuProcessHost::~GpuProcessHost() { | 340 GpuProcessHost::~GpuProcessHost() { |
341 DCHECK(CalledOnValidThread()); | 341 DCHECK(CalledOnValidThread()); |
342 | 342 |
343 SendOutstandingReplies(); | 343 SendOutstandingReplies(); |
344 // Ending only acts as a failure if the GPU process was actually started and | 344 // Ending only acts as a failure if the GPU process was actually started and |
345 // was intended for actual rendering (and not just checking caps or other | 345 // was intended for actual rendering (and not just checking caps or other |
346 // options). | 346 // options). |
347 if (process_launched_ && kind_ == GPU_PROCESS_KIND_SANDBOXED) { | 347 if (process_launched_ && kind_ == GPU_PROCESS_KIND_SANDBOXED) { |
348 if (software_rendering_) { | 348 if (software_rendering_) { |
| 349 UMA_HISTOGRAM_ENUMERATION("GPU.SoftwareRendererLifetimeEvents", |
| 350 DIED_FIRST_TIME + g_gpu_software_crash_count, |
| 351 GPU_PROCESS_LIFETIME_EVENT_MAX); |
| 352 |
349 if (++g_gpu_software_crash_count >= kGpuMaxCrashCount) { | 353 if (++g_gpu_software_crash_count >= kGpuMaxCrashCount) { |
350 // The software renderer is too unstable to use. Disable it for current | 354 // The software renderer is too unstable to use. Disable it for current |
351 // session. | 355 // session. |
352 gpu_enabled_ = false; | 356 gpu_enabled_ = false; |
353 } | 357 } |
354 } else { | 358 } else { |
| 359 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", |
| 360 DIED_FIRST_TIME + g_gpu_crash_count, |
| 361 GPU_PROCESS_LIFETIME_EVENT_MAX); |
| 362 |
355 if (++g_gpu_crash_count >= kGpuMaxCrashCount) { | 363 if (++g_gpu_crash_count >= kGpuMaxCrashCount) { |
356 #if !defined(OS_CHROMEOS) | 364 #if !defined(OS_CHROMEOS) |
357 // The gpu process is too unstable to use. Disable it for current | 365 // The gpu process is too unstable to use. Disable it for current |
358 // session. | 366 // session. |
359 hardware_gpu_enabled_ = false; | 367 hardware_gpu_enabled_ = false; |
360 GpuDataManagerImpl::GetInstance()->BlacklistCard(); | 368 GpuDataManagerImpl::GetInstance()->BlacklistCard(); |
361 #endif | 369 #endif |
362 } | 370 } |
363 } | 371 } |
364 } | 372 } |
365 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", | |
366 DIED_FIRST_TIME + g_gpu_crash_count, | |
367 GPU_PROCESS_LIFETIME_EVENT_MAX); | |
368 | 373 |
369 int exit_code; | 374 int exit_code; |
370 base::TerminationStatus status = process_->GetTerminationStatus(&exit_code); | 375 base::TerminationStatus status = process_->GetTerminationStatus(&exit_code); |
371 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", | 376 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", |
372 status, | 377 status, |
373 base::TERMINATION_STATUS_MAX_ENUM); | 378 base::TERMINATION_STATUS_MAX_ENUM); |
374 | 379 |
375 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION || | 380 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION || |
376 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { | 381 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { |
377 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode", | 382 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode", |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 const IPC::ChannelHandle& channel_handle, | 872 const IPC::ChannelHandle& channel_handle, |
868 base::ProcessHandle renderer_process_for_gpu, | 873 base::ProcessHandle renderer_process_for_gpu, |
869 const content::GPUInfo& gpu_info) { | 874 const content::GPUInfo& gpu_info) { |
870 callback.Run(channel_handle, gpu_info); | 875 callback.Run(channel_handle, gpu_info); |
871 } | 876 } |
872 | 877 |
873 void GpuProcessHost::CreateCommandBufferError( | 878 void GpuProcessHost::CreateCommandBufferError( |
874 const CreateCommandBufferCallback& callback, int32 route_id) { | 879 const CreateCommandBufferCallback& callback, int32 route_id) { |
875 callback.Run(route_id); | 880 callback.Run(route_id); |
876 } | 881 } |
OLD | NEW |