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

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

Issue 2302733003: [wip] Kill GPU if the memory buffer cannot be used as advertised.
Patch Set: Created 4 years, 3 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
Index: content/browser/gpu/browser_gpu_memory_buffer_manager.cc
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
index 718c009e44346e6bd7a0928aa4678b5ceca77aef..fcd1a8d4e951afd81269df3b8e8d6a9b11958c06 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -257,6 +257,11 @@ BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
"BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle");
base::ThreadRestrictions::ScopedAllowWait allow_wait;
request.event.Wait();
+ if (!request.result) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ if (host)
+ host->ForceShutdown();
+ }
return std::move(request.result);
}
@@ -422,6 +427,11 @@ BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurface(
"BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurface");
base::ThreadRestrictions::ScopedAllowWait allow_wait;
request.event.Wait();
+ if (!request.result) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ if (host)
+ host->ForceShutdown();
+ }
return std::move(request.result);
}

Powered by Google App Engine
This is Rietveld 408576698