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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged. Created 8 years, 1 month 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 | « webkit/plugins/ppapi/audio_helper.cc ('k') | webkit/plugins/ppapi/ppb_broker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 9e95b0777b8ef6e1bf37ed9f9d0717d0a7780987..795a00e65974d1e2ea9ea2ae928475a9818cbfb7 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -639,8 +639,8 @@ PluginInstance::~PluginInstance() {
i != plugin_object_copy.end(); ++i)
delete *i;
- if (lock_mouse_callback_)
- TrackedCallback::ClearAndAbort(&lock_mouse_callback_);
+ if (TrackedCallback::IsPending(lock_mouse_callback_))
+ lock_mouse_callback_->Abort();
delegate_->InstanceDeleted(this);
module_->InstanceDeleted(this);
@@ -2034,7 +2034,7 @@ void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) {
if (flash_fullscreen == flash_fullscreen_) {
// Manually clear callback when fullscreen fails with mouselock pending.
if (!flash_fullscreen && is_mouselock_pending)
- TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
+ lock_mouse_callback_->Run(PP_ERROR_FAILED);
return;
}
@@ -2053,7 +2053,7 @@ void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) {
flash_fullscreen_ = flash_fullscreen;
if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) {
if (!delegate()->LockMouse(this))
- TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
+ lock_mouse_callback_->Run(PP_ERROR_FAILED);
}
if (PluginHasFocus() != old_plugin_focus)
@@ -2316,10 +2316,8 @@ bool PluginInstance::IsProcessingUserGesture() {
}
void PluginInstance::OnLockMouseACK(bool succeeded) {
- if (TrackedCallback::IsPending(lock_mouse_callback_)) {
- TrackedCallback::ClearAndRun(&lock_mouse_callback_,
- succeeded ? PP_OK : PP_ERROR_FAILED);
- }
+ if (TrackedCallback::IsPending(lock_mouse_callback_))
+ lock_mouse_callback_->Run(succeeded ? PP_OK : PP_ERROR_FAILED);
}
void PluginInstance::OnMouseLockLost() {
« no previous file with comments | « webkit/plugins/ppapi/audio_helper.cc ('k') | webkit/plugins/ppapi/ppb_broker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698