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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 10168026: Delete FunctionGroupBase from Pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 293ebf01074a04345d1c93bfd3a385b46f235282..667a8a217826a5c3c7a07ee6dfcc1d5a9316bb54 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -32,7 +32,7 @@
using ppapi::thunk::EnterInstanceNoLock;
using ppapi::thunk::EnterResourceNoLock;
-using ppapi::thunk::PPB_Instance_FunctionAPI;
+using ppapi::thunk::PPB_Instance_API;
namespace ppapi {
namespace proxy {
@@ -156,10 +156,6 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
return handled;
}
-PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() {
- return this;
-}
-
PP_Bool PPB_Instance_Proxy::BindGraphics(PP_Instance instance,
PP_Resource device) {
Resource* object =
@@ -633,13 +629,19 @@ void PPB_Instance_Proxy::OnHostMsgPostMessage(
}
void PPB_Instance_Proxy::OnHostMsgLockMouse(PP_Instance instance) {
- EnterHostFunctionForceCallback<PPB_Instance_FunctionAPI> enter(
- instance,
- callback_factory_.NewCallback(
- &PPB_Instance_Proxy::MouseLockCompleteInHost,
- instance));
- if (enter.succeeded())
- enter.SetResult(enter.functions()->LockMouse(instance, enter.callback()));
+ // Need to be careful to always issue the callback.
+ 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,
+ cb.pp_completion_callback());
+ if (result != PP_OK_COMPLETIONPENDING)
+ cb.Run(result);
}
void PPB_Instance_Proxy::OnHostMsgUnlockMouse(PP_Instance instance) {
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698