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

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: Created 8 years, 5 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
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/tests/test_mouse_lock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
===================================================================
--- ppapi/proxy/ppb_instance_proxy.cc (revision 145683)
+++ ppapi/proxy/ppb_instance_proxy.cc (working copy)
@@ -645,15 +645,9 @@
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 @@
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;
}
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/tests/test_mouse_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698