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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 1249313004: Remove GPU relinquish resources infrastructure and stop GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only skip recording crash in ~GpuProcessHost() Created 5 years, 5 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 | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a3f8b370e30892dc6ac5183d6e394fd4a735b5bc 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(
@@ -430,7 +431,14 @@ GpuProcessHost::~GpuProcessHost() {
SendOutstandingReplies();
- RecordProcessCrash();
+ // Do not record crash if GPU process was asked to stop and stopped
+ // successfully.
+ int exit_code;
+ if (!expecting_shutdown_ ||
+ process_->GetTerminationStatus(false, &exit_code) !=
+ base::TERMINATION_STATUS_NORMAL_TERMINATION) {
+ RecordProcessCrash();
no sievers 2015/07/28 21:28:50 That's better, but calling RecordProcessCrash() he
no sievers 2015/07/28 21:31:46 I forgot one: You might also want to override OnP
derekjchow1 2015/07/29 18:35:40 Done.
+ }
// In case we never started, clean up.
while (!queued_messages_.empty()) {
@@ -903,6 +911,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) {
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698