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

Unified Diff: ppapi/proxy/irt_ppapi.c

Issue 171093002: NaCl: Move definition of the "ppapihook" IRT interface to the Chromium repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use Chrome * style Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/irt_ppapi.c
diff --git a/ppapi/proxy/irt_ppapi.c b/ppapi/proxy/irt_ppapi.c
index 5d9c2c2346092875b5cab6562e7e8e73b9a34453..64c22aa70273ad56467f65ea4a251e5c5639f039 100644
--- a/ppapi/proxy/irt_ppapi.c
+++ b/ppapi/proxy/irt_ppapi.c
@@ -4,6 +4,7 @@
* found in the LICENSE file.
*/
+#include "native_client/src/public/irt_core.h"
#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/irt/irt_private.h"
#include "ppapi/nacl_irt/irt_ppapi.h"
@@ -32,7 +33,30 @@ const void* PPP_GetInterface(const char* interface_name) {
return g_pp_functions.PPP_GetInterface(interface_name);
}
+/*
+ * TODO(mseaborn): This can be made static when the NaCl side no
+ * longer refers to it.
+ */
const struct nacl_irt_ppapihook nacl_irt_ppapihook = {
irt_ppapi_start,
PpapiPluginRegisterThreadCreator,
};
+
+static const struct nacl_irt_interface irt_interfaces[] = {
+ { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook),
+ NULL },
+};
+
+static size_t chrome_irt_query(const char* interface_ident,
+ void* table, size_t tablesize) {
+ size_t result = nacl_irt_query_core(interface_ident, table, tablesize);
+ if (result != 0)
+ return result;
+ return nacl_irt_query_list(interface_ident, table, tablesize,
+ irt_interfaces, sizeof(irt_interfaces));
+}
+
+void nacl_irt_start(uint32_t* info) {
+ nacl_irt_init(info);
+ nacl_irt_enter_user_code(info, chrome_irt_query);
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698