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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 10699045: Fix PPB_MouseLock.LockMouse crash and add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change in response to Dave's suggestions. Created 8 years, 6 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: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index c68b28699598005f987d84c9d5c1cc0a31e1f435..ea974ef29db254c7426ca35a6f99d264e49bf7f0 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -645,15 +645,9 @@ void PPB_Instance_Proxy::OnHostMsgLockMouse(PP_Instance instance) {
pp::CompletionCallback cb = callback_factory_.NewCallback(
&PPB_Instance_Proxy::MouseLockCompleteInHost, instance);
- EnterInstanceNoLock enter(instance);
- if (enter.failed()) {
- cb.Run(PP_ERROR_BADARGUMENT);
- return;
- }
- int32_t result = enter.functions()->LockMouse(instance,
- enter.callback());
- if (result != PP_OK_COMPLETIONPENDING)
- cb.Run(result);
+ EnterInstanceNoLock enter(instance, cb.pp_completion_callback());
+ if (enter.succeeded())
+ enter.SetResult(enter.functions()->LockMouse(instance, enter.callback()));
}
void PPB_Instance_Proxy::OnHostMsgUnlockMouse(PP_Instance instance) {
@@ -792,7 +786,7 @@ void PPB_Instance_Proxy::OnPluginMsgMouseLockComplete(PP_Instance instance,
GetInstanceData(instance);
if (!data)
return; // Instance was probably deleted.
- if (TrackedCallback::IsPending(data->mouse_lock_callback)) {
+ if (!TrackedCallback::IsPending(data->mouse_lock_callback)) {
NOTREACHED();
return;
}

Powered by Google App Engine
This is Rietveld 408576698