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

Side by Side 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: rebased Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "native_client/src/public/irt_core.h" 5 #include "native_client/src/public/irt_core.h"
6 #include "native_client/src/trusted/service_runtime/include/sys/unistd.h" 6 #include "native_client/src/trusted/service_runtime/include/sys/unistd.h"
7 #include "native_client/src/untrusted/irt/irt.h" 7 #include "native_client/src/untrusted/irt/irt.h"
8 #include "native_client/src/untrusted/irt/irt_private.h" 8 #include "native_client/src/untrusted/irt/irt_private.h"
9 #include "ppapi/nacl_irt/irt_manifest.h"
9 #include "ppapi/nacl_irt/irt_ppapi.h" 10 #include "ppapi/nacl_irt/irt_ppapi.h"
10 #include "ppapi/nacl_irt/plugin_main.h" 11 #include "ppapi/nacl_irt/plugin_main.h"
11 #include "ppapi/nacl_irt/public/irt_ppapi.h" 12 #include "ppapi/nacl_irt/public/irt_ppapi.h"
12 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h" 13 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h"
13 14
14 static struct PP_StartFunctions g_pp_functions; 15 static struct PP_StartFunctions g_pp_functions;
15 16
16 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { 17 int irt_ppapi_start(const struct PP_StartFunctions* funcs) {
17 // Disable NaCl's open_resource() interface on this thread. 18 // Disable NaCl's open_resource() interface on this thread.
18 g_is_main_thread = 1; 19 g_is_main_thread = 1;
(...skipping 20 matching lines...) Expand all
39 PpapiPluginRegisterThreadCreator, 40 PpapiPluginRegisterThreadCreator,
40 }; 41 };
41 42
42 static int ppapihook_pnacl_private_filter(void) { 43 static int ppapihook_pnacl_private_filter(void) {
43 int pnacl_mode = sysconf(NACL_ABI__SC_NACL_PNACL_MODE); 44 int pnacl_mode = sysconf(NACL_ABI__SC_NACL_PNACL_MODE);
44 if (pnacl_mode == -1) 45 if (pnacl_mode == -1)
45 return 0; 46 return 0;
46 return pnacl_mode; 47 return pnacl_mode;
47 } 48 }
48 49
50 static const nacl_irt_resource_open kIrtResourceOpen = {
51 ppapi::IrtOpenResource,
52 };
53
54 static int not_pnacl_filter(void) {
55 int pnacl_mode = sysconf(NACL_ABI__SC_NACL_PNACL_MODE);
56 if (pnacl_mode == -1)
57 return 0;
58 return !pnacl_mode;
59 }
60
49 static const struct nacl_irt_interface irt_interfaces[] = { 61 static const struct nacl_irt_interface irt_interfaces[] = {
50 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook), 62 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook),
51 NULL }, 63 NULL },
52 { NACL_IRT_PPAPIHOOK_PNACL_PRIVATE_v0_1, 64 { NACL_IRT_PPAPIHOOK_PNACL_PRIVATE_v0_1,
53 &nacl_irt_ppapihook_pnacl_private, sizeof(nacl_irt_ppapihook_pnacl_private), 65 &nacl_irt_ppapihook_pnacl_private, sizeof(nacl_irt_ppapihook_pnacl_private),
54 ppapihook_pnacl_private_filter }, 66 ppapihook_pnacl_private_filter },
67 { NACL_IRT_RESOURCE_OPEN_v0_1, &kIrtResourceOpen,
68 sizeof(kIrtResourceOpen), not_pnacl_filter },
55 }; 69 };
56 70
57 size_t chrome_irt_query(const char* interface_ident, 71 size_t chrome_irt_query(const char* interface_ident,
58 void* table, size_t tablesize) { 72 void* table, size_t tablesize) {
59 size_t result = nacl_irt_query_core(interface_ident, table, tablesize); 73 size_t result = nacl_irt_query_list(interface_ident,
74 table,
75 tablesize,
76 irt_interfaces,
77 sizeof(irt_interfaces));
60 if (result != 0) 78 if (result != 0)
61 return result; 79 return result;
62 return nacl_irt_query_list(interface_ident, table, tablesize, 80 return nacl_irt_query_core(interface_ident, table, tablesize);
63 irt_interfaces, sizeof(irt_interfaces));
64 } 81 }
OLDNEW
« 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