Chromium Code Reviews| Index: content/browser/gpu/gpu_process_host.cc |
| diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc |
| index 1c37f80818bda020c0877bb305a5d8b0e1bd5da3..900671038bd600862ca153fa083d0ee737114108 100644 |
| --- a/content/browser/gpu/gpu_process_host.cc |
| +++ b/content/browser/gpu/gpu_process_host.cc |
| @@ -397,6 +397,7 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) |
| kind_(kind), |
| process_launched_(false), |
| initialized_(false), |
| + expecting_shutdown_(false), |
| gpu_crash_recorded_(false), |
| uma_memory_stats_received_(false) { |
| if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| @@ -903,6 +904,11 @@ void GpuProcessHost::ForceShutdown() { |
| process_->ForceShutdown(); |
| } |
| +void GpuProcessHost::StopGpuProcess() { |
| + Send(new GpuMsg_Finalize()); |
| + expecting_shutdown_ = true; |
| +} |
| + |
| void GpuProcessHost::BeginFrameSubscription( |
| int surface_id, |
| base::WeakPtr<RenderWidgetHostViewFrameSubscriber> subscriber) { |
| @@ -1030,6 +1036,18 @@ void GpuProcessHost::RecordProcessCrash() { |
| if (gpu_crash_recorded_) |
| return; |
| + // Skip if GPU process was asked to stop and stopped successfully. |
| + if (expecting_shutdown_) { |
| + expecting_shutdown_ = false; |
| + int exit_code; |
| + base::TerminationStatus status = |
| + process_->GetTerminationStatus(false, &exit_code); |
| + if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION) { |
|
dcheng
2015/07/28 18:47:21
Why does this set gpu_crash_recorded_ to true if i
derekjchow1
2015/07/28 18:57:28
RecordProcessCrash can be called multiple times fo
dcheng
2015/07/28 19:04:27
Huh. That's kind of non-intuitive (both the fact t
no sievers
2015/07/28 19:21:20
Actually it's not quite obvious how you get here.
derekjchow1
2015/07/28 21:01:44
Sure. The only other place RecordProcessCrash is c
|
| + gpu_crash_recorded_ = true; |
| + return; |
| + } |
| + } |
| + |
| // Maximum number of times the GPU process is allowed to crash in a session. |
| // Once this limit is reached, any request to launch the GPU process will |
| // fail. |