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

Unified Diff: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc

Issue 2250473005: content: Fix Context creation logic in ContextProviderFactoryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run the callback once, fix comments. Created 4 years, 4 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/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
diff --git a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
index ec2da9421027402e975acc7343e727ae020b7532..4a6209187841fd1cad1bd24f067cca8fefa63bca 100644
--- a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
+++ b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
@@ -199,7 +199,12 @@ void VideoCaptureGpuJpegDecoder::EstablishGpuChannelOnUIThread(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
base::WeakPtr<VideoCaptureGpuJpegDecoder> weak_this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(BrowserGpuChannelHostFactory::instance());
+
+ // If the factory is unavailable, this means we are shutting down.
+ if (!BrowserGpuChannelHostFactory::instance()) {
+ GpuChannelEstablishedOnUIThread(task_runner, weak_this, nullptr);
+ return;
+ }
BrowserGpuChannelHostFactory::instance()->EstablishGpuChannel(
base::Bind(&VideoCaptureGpuJpegDecoder::GpuChannelEstablishedOnUIThread,

Powered by Google App Engine
This is Rietveld 408576698