From 1bea0d292c065d66f2f509f884023b69d8d37f04 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sun, 5 Feb 2012 03:07:29 +0000 Subject: Convert most users in thunk that used MayForceCallback to use the new Enter... format that does callback validation and forcing in its destructor. This adds the same support for callback tracking for EnterFunction... as my previous patch did for EnterResource. Review URL: http://codereview.chromium.org/9113044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120499 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/thunk/ppb_mouse_lock_thunk.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ppapi/thunk/ppb_mouse_lock_thunk.cc') diff --git a/ppapi/thunk/ppb_mouse_lock_thunk.cc b/ppapi/thunk/ppb_mouse_lock_thunk.cc index 167a537..11d2012 100644 --- a/ppapi/thunk/ppb_mouse_lock_thunk.cc +++ b/ppapi/thunk/ppb_mouse_lock_thunk.cc @@ -4,7 +4,6 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_mouse_lock.h" -#include "ppapi/thunk/common.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/ppb_instance_api.h" #include "ppapi/thunk/thunk.h" @@ -15,11 +14,10 @@ namespace thunk { namespace { int32_t LockMouse(PP_Instance instance, PP_CompletionCallback callback) { - EnterFunction enter(instance, true); + EnterFunction enter(instance, callback, true); if (enter.failed()) - return MayForceCallback(callback, PP_ERROR_BADARGUMENT); - int32_t result = enter.functions()->LockMouse(instance, callback); - return MayForceCallback(callback, result); + return enter.retval(); + return enter.SetResult(enter.functions()->LockMouse(instance, callback)); } void UnlockMouse(PP_Instance instance) { -- cgit v1.1