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 9db43c78485cbadc0969a25a56f7826903bf88fa..ed8a172ab366e9445c768be36903f2a065997fad 100644 |
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc |
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc |
@@ -338,6 +338,13 @@ void BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferOnIO( |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
BufferMap& buffers = clients_[client_id]; |
+ GpuProcessHost* host = GpuProcessHost::Get(); |
+ if (!host) { |
+ DLOG(ERROR) << "Cannot allocate GpuMemoryBuffer with no GpuProcessHost."; |
+ callback.Run(gfx::GpuMemoryBufferHandle()); |
+ return; |
+ } |
+ |
// Note: Handling of cases where the client is removed before the allocation |
// completes is less subtle if we set the buffer type to EMPTY_BUFFER here |
// and verify that this has not changed when creation completes. |
@@ -350,7 +357,6 @@ void BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferOnIO( |
return; |
} |
- GpuProcessHost* host = GpuProcessHost::Get(); |
// Note: Unretained is safe as IO thread is stopped before manager is |
// destroyed. |
host->CreateGpuMemoryBuffer( |