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

Side by Side Diff: ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.c

Issue 1512233002: PPAPI/NaCl: Move plugin_main.cc's contents into irt_ppapi.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « ppapi/nacl_irt/plugin_startup.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h" 7 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h"
8 8
9 #include "native_client/src/untrusted/irt/irt.h" 9 #include "native_client/src/untrusted/irt/irt.h"
10 #include "ppapi/nacl_irt/irt_ppapi.h"
10 #include "ppapi/nacl_irt/public/irt_ppapi.h" 11 #include "ppapi/nacl_irt/public/irt_ppapi.h"
11 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.h" 12 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.h"
12 #include "ppapi/nacl_irt/plugin_main.h"
13 13
14 /* 14 /*
15 * Defines a version of the version irt_ppapi_start and of the irt_ppapihook 15 * Defines a version of the version irt_ppapi_start and of the irt_ppapihook
16 * that returns a shimmed GetInterface for PNaCl. 16 * that returns a shimmed GetInterface for PNaCl.
17 * 17 *
18 * The hook will be linked into the IRT but it is considered unstable. 18 * The hook will be linked into the IRT but it is considered unstable.
19 * Stable nexes should not use that IRT hook (and a filter prevents 19 * Stable nexes should not use that IRT hook (and a filter prevents
20 * it from being used). Instead PNaCl nexes should embed the 20 * it from being used). Instead PNaCl nexes should embed the
21 * irt_shim_ppapi_start and the shim functions directly into the nexe 21 * irt_shim_ppapi_start and the shim functions directly into the nexe
22 * for ABI stability. 22 * for ABI stability.
(...skipping 18 matching lines...) Expand all
41 /* 41 /*
42 * This will be discovered and set by the shim, since we cannot link 42 * This will be discovered and set by the shim, since we cannot link
43 * against the IRT directly in the AOT library. 43 * against the IRT directly in the AOT library.
44 */ 44 */
45 int (*real_irt_ppapi_start)(const struct PP_StartFunctions *) = NULL; 45 int (*real_irt_ppapi_start)(const struct PP_StartFunctions *) = NULL;
46 #else 46 #else
47 /* 47 /*
48 * Otherwise, when linking directly into the IRT, we can refer to the 48 * Otherwise, when linking directly into the IRT, we can refer to the
49 * real irt_ppapi_start from irt_ppapi. 49 * real irt_ppapi_start from irt_ppapi.
50 */ 50 */
51 extern int irt_ppapi_start(const struct PP_StartFunctions *);
52 static int (* const real_irt_ppapi_start)(const struct PP_StartFunctions *) = 51 static int (* const real_irt_ppapi_start)(const struct PP_StartFunctions *) =
53 &irt_ppapi_start; 52 &irt_ppapi_start;
54 #endif 53 #endif
55 54
56 int irt_shim_ppapi_start(const struct PP_StartFunctions *funcs) { 55 int irt_shim_ppapi_start(const struct PP_StartFunctions *funcs) {
57 g_user_start_functions = *funcs; 56 g_user_start_functions = *funcs;
58 /* 57 /*
59 * Record the original PPP_GetInterface and provide a shimmed one 58 * Record the original PPP_GetInterface and provide a shimmed one
60 * via wrapped_ppapi_methods. 59 * via wrapped_ppapi_methods.
61 */ 60 */
62 const struct PP_StartFunctions wrapped_ppapi_methods = { 61 const struct PP_StartFunctions wrapped_ppapi_methods = {
63 shim_PPPInitializeModule, 62 shim_PPPInitializeModule,
64 shim_PPPShutdownModule, 63 shim_PPPShutdownModule,
65 __Pnacl_PPPGetInterface 64 __Pnacl_PPPGetInterface
66 }; 65 };
67 __set_real_Pnacl_PPPGetInterface(g_user_start_functions.PPP_GetInterface); 66 __set_real_Pnacl_PPPGetInterface(g_user_start_functions.PPP_GetInterface);
68 /* 67 /*
69 * Invoke the IRT's ppapi_start interface with the wrapped interface. 68 * Invoke the IRT's ppapi_start interface with the wrapped interface.
70 */ 69 */
71 return (*real_irt_ppapi_start)(&wrapped_ppapi_methods); 70 return (*real_irt_ppapi_start)(&wrapped_ppapi_methods);
72 } 71 }
73 72
74 #ifndef PNACL_SHIM_AOT 73 #ifndef PNACL_SHIM_AOT
75 const struct nacl_irt_ppapihook nacl_irt_ppapihook_pnacl_private = { 74 const struct nacl_irt_ppapihook nacl_irt_ppapihook_pnacl_private = {
76 irt_shim_ppapi_start, 75 irt_shim_ppapi_start,
77 PpapiPluginRegisterThreadCreator, 76 PpapiPluginRegisterThreadCreator,
78 }; 77 };
79 #endif 78 #endif
OLDNEW
« no previous file with comments | « ppapi/nacl_irt/plugin_startup.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698