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

Unified Diff: gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: . Created 4 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 side-by-side diff with in-line comments
Download patch
Index: gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
diff --git a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
index f8680781beff9246f84df2bf3e7f8de26f47858a..c7b24de9edc235c27637ef9927aed357a0ae7e51 100644
--- a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -68,6 +68,11 @@ WebGraphicsContext3DInProcessCommandBufferImpl::
WebGraphicsContext3DInProcessCommandBufferImpl::
~WebGraphicsContext3DInProcessCommandBufferImpl() {
+ if (real_gl_) {
+ real_gl_->SetErrorMessageCallback(
+ base::Callback<void(const char*, int32_t)>());
+ real_gl_->SetLostContextCallback(base::Closure());
+ }
}
size_t WebGraphicsContext3DInProcessCommandBufferImpl::GetMappedMemoryLimit() {
@@ -96,12 +101,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() {
::gpu::GLInProcessContextSharedMemoryLimits(), nullptr, nullptr));
}
- if (context_) {
- base::Closure context_lost_callback = base::Bind(
- &WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost,
- base::Unretained(this));
- context_->SetContextLostCallback(context_lost_callback);
- } else {
+ if (!context_) {
initialize_failed_ = true;
return false;
}
@@ -109,6 +109,16 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() {
real_gl_ = context_->GetImplementation();
SetGLInterface(real_gl_);
+ real_gl_->SetErrorMessageCallback(base::Bind(
+ // This method is in WebGraphicsContext3DImpl.
+ &WebGraphicsContext3DInProcessCommandBufferImpl::OnErrorMessage,
danakj 2016/04/06 02:14:15 I started setting this here, but I don't think thi
+ // The callback is unset in the destructor.
+ base::Unretained(this)));
+ real_gl_->SetLostContextCallback(
+ base::Bind(&WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost,
+ // The callback is unset in the destructor.
+ base::Unretained(this)));
+
real_gl_->TraceBeginCHROMIUM("WebGraphicsContext3D",
"InProcessContext");

Powered by Google App Engine
This is Rietveld 408576698