From 6b9ec39613fb9fdaa52dcf215e5099ff05c686de Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Thu, 16 Feb 2012 03:37:44 +0000 Subject: Fix nested invocation of graphics 2D Flush. This fixes the Graphics 2D Flush ABORT callback to be a task instead of being executed in a nested context. Previously, this would cause crashes because you would get a paint message when destroying the paint manager. This new way will issue the callback later. In the case of the paint manager, the scoped callback factory will just drop the callback on the floor. I added a check in the paint manager code just in case we add future failure cases, we don't want to continue painting. BUG=http://crbug.com/108688 Review URL: http://codereview.chromium.org/9404019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122234 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc') diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index 9be560a..9c8b2f3 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -202,10 +202,8 @@ void PPB_Graphics2D_Impl::LastPluginRefWasDeleted() { Resource::LastPluginRefWasDeleted(); // Abort any pending callbacks. - if (!unpainted_flush_callback_.is_null()) - unpainted_flush_callback_.Execute(PP_ERROR_ABORTED); - if (!painted_flush_callback_.is_null()) - painted_flush_callback_.Execute(PP_ERROR_ABORTED); + unpainted_flush_callback_.PostAbort(); + painted_flush_callback_.PostAbort(); } PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, -- cgit v1.1