summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppp_instance_proxy.cc
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 18:53:59 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 18:53:59 +0000
commit38d035e33fc2fac4f5c23819c6974afe2caff47b (patch)
tree82ecf8f419fbc6aafda5a068c03af0b1dd5acc75 /ppapi/proxy/ppp_instance_proxy.cc
parente43145482ea2623ef59ff8c4cc5c10ccad8302a9 (diff)
downloadchromium_src-38d035e33fc2fac4f5c23819c6974afe2caff47b.zip
chromium_src-38d035e33fc2fac4f5c23819c6974afe2caff47b.tar.gz
chromium_src-38d035e33fc2fac4f5c23819c6974afe2caff47b.tar.bz2
Revert 93223 - Reland http://codereview.chromium.org/7452002/
Update chromoting input events. (Clang caught this. Thanks, Clang!) Note I'm leaving in temporary backwards-compatibility. brettw, just need a rubber-stamp. This is the same as the last CL. awong/garykac/sergeyu, looking for someone on chromoting team to glance at my changes and make sure I didn't do anything you don't like. This is a high priority for 14, so please look if you can. BUG=None TEST=ppapi tests Review URL: http://codereview.chromium.org/7466002 TBR=dmichael@chromium.org Review URL: http://codereview.chromium.org/7471006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppp_instance_proxy.cc')
-rw-r--r--ppapi/proxy/ppp_instance_proxy.cc34
1 files changed, 29 insertions, 5 deletions
diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc
index cc2f9db..99dcaab 100644
--- a/ppapi/proxy/ppp_instance_proxy.cc
+++ b/ppapi/proxy/ppp_instance_proxy.cc
@@ -65,6 +65,21 @@ void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) {
instance, has_focus));
}
+PP_Bool HandleInputEvent(PP_Instance instance,
+ const PP_InputEvent* event) {
+ PP_Bool result = PP_FALSE;
+ IPC::Message* msg = new PpapiMsg_PPPInstance_HandleInputEvent(
+ INTERFACE_ID_PPP_INSTANCE, instance, *event, &result);
+ // Make this message not unblock, to avoid re-entrancy problems when the
+ // plugin does a synchronous call to the renderer. This will force any
+ // synchronous calls from the plugin to complete before processing this
+ // message. We avoid deadlock by never un-setting the unblock flag on messages
+ // from the plugin to the renderer.
+ msg->set_unblock(false);
+ HostDispatcher::GetForInstance(instance)->Send(msg);
+ return result;
+}
+
PP_Bool HandleDocumentLoad(PP_Instance instance,
PP_Resource url_loader) {
PP_Bool result = PP_FALSE;
@@ -97,11 +112,12 @@ PP_Bool HandleDocumentLoad(PP_Instance instance,
return result;
}
-static const PPP_Instance_1_0 instance_interface_1_0 = {
+static const PPP_Instance_0_5 instance_interface_0_5 = {
&DidCreate,
&DidDestroy,
&DidChangeView,
&DidChangeFocus,
+ &HandleInputEvent,
&HandleDocumentLoad
};
@@ -119,13 +135,13 @@ PPP_Instance_Proxy::~PPP_Instance_Proxy() {
}
// static
-const InterfaceProxy::Info* PPP_Instance_Proxy::GetInfo1_0() {
+const InterfaceProxy::Info* PPP_Instance_Proxy::GetInfo0_5() {
static const Info info = {
- &instance_interface_1_0,
- PPP_INSTANCE_INTERFACE_1_0,
+ &instance_interface_0_5,
+ PPP_INSTANCE_INTERFACE_0_5,
INTERFACE_ID_PPP_INSTANCE,
false,
- &CreateInstanceProxy<PPP_Instance_1_0>,
+ &CreateInstanceProxy<PPP_Instance_0_5>,
};
return &info;
}
@@ -141,6 +157,8 @@ bool PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgDidChangeView)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeFocus,
OnMsgDidChangeFocus)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleInputEvent,
+ OnMsgHandleInputEvent)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleDocumentLoad,
OnMsgHandleDocumentLoad)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -206,6 +224,12 @@ void PPP_Instance_Proxy::OnMsgDidChangeFocus(PP_Instance instance,
combined_interface_->DidChangeFocus(instance, has_focus);
}
+void PPP_Instance_Proxy::OnMsgHandleInputEvent(PP_Instance instance,
+ const PP_InputEvent& event,
+ PP_Bool* result) {
+ *result = combined_interface_->HandleInputEvent(instance, &event);
+}
+
void PPP_Instance_Proxy::OnMsgHandleDocumentLoad(PP_Instance instance,
const HostResource& url_loader,
PP_Bool* result) {