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

Unified Diff: chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc

Issue 6099015: Fix swapbuffers callback crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/renderer/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 1be54610cbf89ce6ffa1b5915bfd5aa91d452152..c6c4b5b0e73d4d05a4aeb4f8c412acf6d8413b49 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -119,7 +119,8 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
if (context_) {
ggl::SetSwapBuffersCallback(
context_,
- NewCallback(renderview, &RenderView::DidFlushPaint));
+ NewCallback(this,
+ &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffers));
}
} else {
bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
@@ -1033,4 +1034,12 @@ void WebGraphicsContext3DCommandBufferImpl::copyTextureToCompositor(
glFlush();
}
+void WebGraphicsContext3DCommandBufferImpl::OnSwapBuffers() {
+ // This may be called after tear-down of the RenderView.
+ RenderView* renderview =
+ web_view_ ? RenderView::FromWebView(web_view_) : NULL;
+ if (renderview)
+ renderview->DidFlushPaint();
+}
+
#endif // defined(ENABLE_GPU)
« no previous file with comments | « chrome/renderer/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698