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

Side by Side Diff: content/browser/renderer_host/media/video_capture_texture_wrapper.cc

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/video_capture_texture_wrapper.h" 5 #include "content/browser/renderer_host/media/video_capture_texture_wrapper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/compositor/image_transport_factory.h" 8 #include "content/browser/compositor/image_transport_factory.h"
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
10 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 10 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 DCHECK(gpu_channel_host); 91 DCHECK(gpu_channel_host);
92 return CreateContextCommon(gpu_channel_host, 0); 92 return CreateContextCommon(gpu_channel_host, 0);
93 } 93 }
94 94
95 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)> 95 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)>
96 ProcessContextCallback; 96 ProcessContextCallback;
97 97
98 void CreateContextOnUIThread(ProcessContextCallback bottom_half) { 98 void CreateContextOnUIThread(ProcessContextCallback bottom_half) {
99 DCHECK_CURRENTLY_ON(BrowserThread::UI); 99 DCHECK_CURRENTLY_ON(BrowserThread::UI);
100 bottom_half.Run(ContextProviderCommandBuffer::Create( 100 bottom_half.Run(ContextProviderCommandBuffer::Create(
101 CreateOffscreenCommandBufferContext(), "Offscreen-CaptureThread")); 101 CreateOffscreenCommandBufferContext(), OFFSCREEN_VIDEO_CAPTURE_CONTEXT));
102 return; 102 return;
103 } 103 }
104 104
105 void ResetLostContextCallback( 105 void ResetLostContextCallback(
106 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) { 106 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) {
107 capture_thread_context->SetLostContextCallback( 107 capture_thread_context->SetLostContextCallback(
108 cc::ContextProvider::LostContextCallback()); 108 cc::ContextProvider::LostContextCallback());
109 } 109 }
110 110
111 } // anonymous namespace 111 } // anonymous namespace
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 void VideoCaptureTextureWrapper::TextureWrapperDelegate::OnError( 454 void VideoCaptureTextureWrapper::TextureWrapperDelegate::OnError(
455 const std::string& message) { 455 const std::string& message) {
456 DCHECK(capture_task_runner_->BelongsToCurrentThread()); 456 DCHECK(capture_task_runner_->BelongsToCurrentThread());
457 DLOG(ERROR) << message; 457 DLOG(ERROR) << message;
458 BrowserThread::PostTask( 458 BrowserThread::PostTask(
459 BrowserThread::IO, FROM_HERE, 459 BrowserThread::IO, FROM_HERE,
460 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); 460 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_));
461 } 461 }
462 462
463 } // namespace content 463 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698