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

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
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 021dc7220596b0be0e0bc13c226c4af3163a5737..214807204fa13fd1be18be4a738ac2b8592290ab 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 =
@@ -629,13 +625,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(
brettw 2012/04/21 19:50:01 This changed because I deleted EnterHostFunctionFo
+ &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) {

Powered by Google App Engine
This is Rietveld 408576698