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

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: merge Created 8 years, 3 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: 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 3a357a8e5fc0b716417c5396fc92368ce26dcb16..0f083b3e304a1c7311ec03ef7b3b8bdbe37ba9c2 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -479,8 +479,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);
@@ -1642,7 +1642,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;
}
@@ -1650,7 +1650,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)
@@ -1911,10 +1911,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() {

Powered by Google App Engine
This is Rietveld 408576698