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

Unified Diff: src/shared/ppapi_proxy/browser_ppb_input_event_rpc_server.cc

Issue 7395005: Proxy PPB_Input_Event, PPP_Input_Event, and associated IFs. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: copyright headers Created 9 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 | « src/shared/ppapi_proxy/browser_globals.cc ('k') | src/shared/ppapi_proxy/browser_ppp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/ppapi_proxy/browser_ppb_input_event_rpc_server.cc
diff --git a/src/shared/ppapi_proxy/browser_ppb_input_event_rpc_server.cc b/src/shared/ppapi_proxy/browser_ppb_input_event_rpc_server.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5ee36de5c9502f14a87ffdecf4467ed4ff796ad4
--- /dev/null
+++ b/src/shared/ppapi_proxy/browser_ppb_input_event_rpc_server.cc
@@ -0,0 +1,70 @@
+// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// SRPC-abstraction wrappers around PPB_InputEvent functions.
+
+#include "native_client/src/include/portability.h"
+#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
+#include "native_client/src/shared/ppapi_proxy/browser_ppp_input_event.h"
+#include "native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h"
+#include "native_client/src/shared/ppapi_proxy/utility.h"
+#include "native_client/src/third_party/ppapi/c/pp_errors.h"
+#include "native_client/src/third_party/ppapi/c/ppb_input_event.h"
+
+
+using ppapi_proxy::DebugPrintf;
+
+void PpbInputEventRpcServer::PPB_InputEvent_RequestInputEvents(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ int32_t event_classes,
+ int32_t filtering,
+ int32_t* success) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+ *success = PP_ERROR_FAILED;
+ DebugPrintf("PPB_InputEvent::RequestInputEvents: instance=%"NACL_PRIu32", "
+ "event_classes=%"NACL_PRIu32", filtering=%"NACL_PRId32"\n",
+ instance, static_cast<uint32_t>(event_classes), filtering);
+ const PPB_InputEvent* input_event_if = ppapi_proxy::PPBInputEventInterface();
+ if (!input_event_if) {
+ *success = PP_ERROR_NOTSUPPORTED;
+ DebugPrintf("PPB_InputEvent::RequestInputEvents: success=%"NACL_PRId32"\n",
+ *success);
+ return;
+ }
+ if (filtering) {
+ *success = input_event_if->RequestFilteringInputEvents(
+ instance,
+ static_cast<uint32_t>(event_classes));
+ } else {
+ *success = input_event_if->RequestInputEvents(
+ instance,
+ static_cast<uint32_t>(event_classes));
+ }
+ DebugPrintf("PPB_InputEvent::RequestInputEvents: success=%"NACL_PRId32"\n",
+ *success);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+void PpbInputEventRpcServer::PPB_InputEvent_ClearInputEventRequest(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ int32_t event_classes) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+ DebugPrintf("PPB_InputEvent::ClearInputEventRequest: instance=%"NACL_PRIu32
+ ", event_classes=%"NACL_PRIu32"\n",
+ instance, static_cast<uint32_t>(event_classes));
+ const PPB_InputEvent* input_event_if = ppapi_proxy::PPBInputEventInterface();
+ if (!input_event_if) {
+ return;
+ }
+ input_event_if->ClearInputEventRequest(instance,
+ static_cast<uint32_t>(event_classes));
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
« no previous file with comments | « src/shared/ppapi_proxy/browser_globals.cc ('k') | src/shared/ppapi_proxy/browser_ppp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698