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

Unified Diff: content/renderer/pepper/pepper_graphics_2d_host.cc

Issue 11571016: Only unbind a Graphics2D on destruction when we're actually bound. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_graphics_2d_host.cc
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc
index 2c04d761460bc8a77ddadbe02c7270b60a4f8ff0..41f9c72039c6a7c582368cce08eaf6358af2ef63 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.cc
+++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -42,11 +42,11 @@ PepperGraphics2DHost::PepperGraphics2DHost(RendererPpapiHost* host,
}
PepperGraphics2DHost::~PepperGraphics2DHost() {
- // Unbind from the instance when destoryed.
- PP_Instance instance = graphics_2d_->pp_instance();
- ppapi::thunk::EnterInstanceNoLock enter(instance);
- if (enter.succeeded())
- enter.functions()->BindGraphics(instance, 0);
+ // Unbind from the instance when destroyed if we're still bound.
+ webkit::ppapi::PluginInstance* bound_instance =
+ graphics_2d_->bound_instance();
+ if (bound_instance)
+ bound_instance->BindGraphics(bound_instance->pp_instance(), 0);
}
int32_t PepperGraphics2DHost::OnResourceMessageReceived(
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698