Index: src/untrusted/irt/irt_interfaces.c |
=================================================================== |
--- src/untrusted/irt/irt_interfaces.c (revision 9381) |
+++ src/untrusted/irt/irt_interfaces.c (working copy) |
@@ -30,6 +30,7 @@ |
{ NACL_IRT_BLOCKHOOK_v0_1, &nacl_irt_blockhook, sizeof(nacl_irt_blockhook) }, |
{ NACL_IRT_RESOURCE_OPEN_v0_1, &nacl_irt_resource_open, |
sizeof(nacl_irt_resource_open) }, |
+/* @IGNORE_LINES_FOR_CODE_HYGIENE[1] */ |
#ifdef IRT_PPAPI |
{ NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook) }, |
{ NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random) }, |
@@ -39,10 +40,28 @@ |
sizeof(nacl_irt_dev_exception_handling) }, |
}; |
+/* controls whether cc shim'ed tables should be used */ |
+int g_use_cc_shim = 0; |
+ |
size_t nacl_irt_interface(const char *interface_ident, |
- void *table, size_t tablesize) { |
- int i; |
- for (i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) { |
+ void *table, |
+ size_t tablesize) { |
+ /* |
+ * fast track for a few hooks indicated by a leading '@' |
+ * Other things that could be added here: |
+ * * irt verbosity control |
+ * * irt strict mode (abort on failure) |
+ * * etc. |
+ */ |
+ if (interface_ident[0] == '@') { |
Roland McGrath
2012/08/06 23:32:24
I don't see any defensible rationale for this klud
Robert Muth (chromium)
2012/08/07 14:45:40
added a new interface but this will likely complic
|
+ if (0 == strcmp(interface_ident, "@nacl-cc-shim-mode")) { |
+ g_use_cc_shim = 1; |
+ } |
+ /* TODO(robertm): add better error/success handling */ |
+ return 0; |
+ } |
+ |
+ for (int i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) { |
if (0 == strcmp(interface_ident, irt_interfaces[i].name)) { |
const size_t size = irt_interfaces[i].size; |
if (size <= tablesize) { |