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

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

Issue 1749263003: Don't block 3D apis if GPU process shut down was expected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctxrestore
Patch Set: remove ifdef Created 4 years, 9 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 | « no previous file | no next file » | 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 3433b55b971152f985d05fb3d663158639a76bdb..e79de7d45753c8dd678c031699b60154b74e656f 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -457,11 +457,6 @@ GpuProcessHost::~GpuProcessHost() {
if (g_gpu_process_hosts[kind_] == this)
g_gpu_process_hosts[kind_] = NULL;
- // If there are any remaining offscreen contexts at the point the
- // GPU process exits, assume something went wrong, and block their
- // URLs from accessing client 3D APIs without prompting.
- BlockLiveOffscreenContexts();
-
UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount",
GpuSurfaceTracker::Get()->GetSurfaceCount());
UMA_HISTOGRAM_BOOLEAN("GPU.AtExitReceivedMemoryStats",
@@ -479,6 +474,7 @@ GpuProcessHost::~GpuProcessHost() {
}
std::string message;
+ bool block_offscreen_contexts = true;
if (!in_process_) {
int exit_code;
base::TerminationStatus status = process_->GetTerminationStatus(
@@ -496,6 +492,10 @@ GpuProcessHost::~GpuProcessHost() {
switch (status) {
case base::TERMINATION_STATUS_NORMAL_TERMINATION:
+ // Don't block offscreen contexts (and force page reload for webgl)
+ // if this was an intentional shutdown or the OOM killer on Android
+ // killed us while Chrome was in the background.
+ block_offscreen_contexts = false;
message = "The GPU process exited normally. Everything is okay.";
break;
case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
@@ -522,6 +522,12 @@ GpuProcessHost::~GpuProcessHost() {
}
}
+ // If there are any remaining offscreen contexts at the point the
+ // GPU process exits, assume something went wrong, and block their
+ // URLs from accessing client 3D APIs without prompting.
+ if (block_offscreen_contexts)
+ BlockLiveOffscreenContexts();
+
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&GpuProcessHostUIShim::Destroy,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698