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

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: Remove gpu_crash_recorded_. 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..0bfb8287ca8633902bec21179f161dce8d872a61 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -330,6 +330,10 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
if (host->Init())
return host;
+ // TODO(sievers): Revisit this behavior. It's not really a crash, but we also
+ // want the fallback-to-sw behavior if we cannot initialize the GPU.
+ host->RecordProcessCrash();
+
delete host;
return NULL;
}
@@ -397,7 +401,6 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
kind_(kind),
process_launched_(false),
initialized_(false),
- gpu_crash_recorded_(false),
uma_memory_stats_received_(false) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess) ||
@@ -430,8 +433,6 @@ GpuProcessHost::~GpuProcessHost() {
SendOutstandingReplies();
- RecordProcessCrash();
-
// In case we never started, clean up.
while (!queued_messages_.empty()) {
delete queued_messages_.front();
@@ -876,6 +877,10 @@ void GpuProcessHost::OnProcessLaunched() {
base::TimeTicks::Now() - init_start_time_);
}
+void GpuProcessHost::OnProcessLaunchFailed() {
+ RecordProcessCrash();
+}
+
void GpuProcessHost::OnProcessCrashed(int exit_code) {
SendOutstandingReplies();
RecordProcessCrash();
@@ -903,6 +908,10 @@ void GpuProcessHost::ForceShutdown() {
process_->ForceShutdown();
}
+void GpuProcessHost::StopGpuProcess() {
+ Send(new GpuMsg_Finalize());
+}
+
void GpuProcessHost::BeginFrameSubscription(
int surface_id,
base::WeakPtr<RenderWidgetHostViewFrameSubscriber> subscriber) {
@@ -1026,10 +1035,6 @@ void GpuProcessHost::BlockLiveOffscreenContexts() {
}
void GpuProcessHost::RecordProcessCrash() {
- // Skip if a GPU process crash was already counted.
- if (gpu_crash_recorded_)
- 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.
@@ -1045,7 +1050,6 @@ void GpuProcessHost::RecordProcessCrash() {
// was intended for actual rendering (and not just checking caps or other
// options).
if (process_launched_ && kind_ == GPU_PROCESS_KIND_SANDBOXED) {
- gpu_crash_recorded_ = true;
if (swiftshader_rendering_) {
UMA_HISTOGRAM_ENUMERATION("GPU.SwiftShaderLifetimeEvents",
DIED_FIRST_TIME + swiftshader_crash_count_,
« 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