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

Unified Diff: ppapi/nacl_irt/irt_ppapi.cc

Issue 418423002: Pepper: Stop using SRPC for irt_open_resource(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows fix Created 6 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 | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | ppapi/nacl_irt/irt_start.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/nacl_irt/irt_ppapi.cc
diff --git a/ppapi/nacl_irt/irt_ppapi.cc b/ppapi/nacl_irt/irt_ppapi.cc
index 1d41f518c4fabd535979bc1c240734fa06acfb7a..219c077f0ceba1c21107bff1a6fe51acbd1e9036 100644
--- a/ppapi/nacl_irt/irt_ppapi.cc
+++ b/ppapi/nacl_irt/irt_ppapi.cc
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdio.h>
dmichael (off chromium) 2014/08/05 16:04:04 ^^^ I'm assuming this is leftover from debugging?
teravest 2014/08/05 18:15:29 Removed.
+
#include "native_client/src/public/irt_core.h"
#include "native_client/src/trusted/service_runtime/include/sys/unistd.h"
#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/irt/irt_private.h"
+#include "ppapi/nacl_irt/irt_manifest.h"
#include "ppapi/nacl_irt/irt_ppapi.h"
#include "ppapi/nacl_irt/plugin_main.h"
#include "ppapi/nacl_irt/public/irt_ppapi.h"
@@ -46,19 +49,32 @@ static int ppapihook_pnacl_private_filter(void) {
return pnacl_mode;
}
+const nacl_irt_resource_open kIrtResourceOpen = {
+ ppapi::IrtOpenResource,
+};
+
+static int not_pnacl_filter(void) {
+ int pnacl_mode = sysconf(NACL_ABI__SC_NACL_PNACL_MODE);
+ if (pnacl_mode == -1)
+ return 0;
+ return !pnacl_mode;
dmichael (off chromium) 2014/08/05 16:04:04 I assume it's idiomatic C to apply ! to an int? Th
teravest 2014/08/05 18:15:29 I think !pnacl_mode looks more natural than pnacl_
+}
+
static const struct nacl_irt_interface irt_interfaces[] = {
{ NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook),
NULL },
{ NACL_IRT_PPAPIHOOK_PNACL_PRIVATE_v0_1,
&nacl_irt_ppapihook_pnacl_private, sizeof(nacl_irt_ppapihook_pnacl_private),
ppapihook_pnacl_private_filter },
+ { NACL_IRT_RESOURCE_OPEN_v0_1, &kIrtResourceOpen,
+ sizeof(kIrtResourceOpen), not_pnacl_filter },
};
size_t chrome_irt_query(const char* interface_ident,
void* table, size_t tablesize) {
dmichael (off chromium) 2014/08/05 16:04:04 chromium style nit: In a function declaration or d
teravest 2014/08/05 18:15:29 Done.
- size_t result = nacl_irt_query_core(interface_ident, table, tablesize);
+ size_t result = nacl_irt_query_list(interface_ident, table, tablesize,
+ irt_interfaces, sizeof(irt_interfaces));
if (result != 0)
return result;
- return nacl_irt_query_list(interface_ident, table, tablesize,
- irt_interfaces, sizeof(irt_interfaces));
+ return nacl_irt_query_core(interface_ident, table, tablesize);
}
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | ppapi/nacl_irt/irt_start.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698