OLD | NEW |
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 /* | 7 /* |
8 * This is a minimal NaCl program without libc. It uses NaCl's stable IRT ABI. | 8 * This is a minimal NaCl program without libc. It uses NaCl's stable IRT ABI. |
9 */ | 9 */ |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 Elf_auxv_t* auxv = nacl_startup_auxv(info); | 214 Elf_auxv_t* auxv = nacl_startup_auxv(info); |
215 grok_auxv(auxv); | 215 grok_auxv(auxv); |
216 DO_QUERY(NACL_IRT_BASIC_v0_1, __libnacl_irt_basic); | 216 DO_QUERY(NACL_IRT_BASIC_v0_1, __libnacl_irt_basic); |
217 DO_QUERY(NACL_IRT_RANDOM_v0_1, __libnacl_irt_random); | 217 DO_QUERY(NACL_IRT_RANDOM_v0_1, __libnacl_irt_random); |
218 | 218 |
219 struct nacl_irt_ppapihook ppapihook; | 219 struct nacl_irt_ppapihook ppapihook; |
220 DO_QUERY(NACL_IRT_PPAPIHOOK_v0_1, ppapihook); | 220 DO_QUERY(NACL_IRT_PPAPIHOOK_v0_1, ppapihook); |
221 | 221 |
222 /* This is local as a workaround to avoid having to apply | 222 /* This is local as a workaround to avoid having to apply |
223 * relocations to global variables. */ | 223 * relocations to global variables. */ |
224 struct PP_StartFunctions start_funcs = { | 224 struct PP_StartFunctions start_funcs; |
225 MyPPP_InitializeModule, | 225 start_funcs.PPP_InitializeModule = MyPPP_InitializeModule; |
226 MyPPP_ShutdownModule, | 226 start_funcs.PPP_ShutdownModule = MyPPP_ShutdownModule; |
227 MyPPP_GetInterface, | 227 start_funcs.PPP_GetInterface = MyPPP_GetInterface; |
228 }; | 228 /* Similarly, initialize some global variables, avoiding relocations. */ |
229 /* Similarly, initialise some global variables, avoiding relocations. */ | 229 ppp_instance.DidCreate = DidCreate; |
230 struct PPP_Instance_1_0 local_ppp_instance = { | 230 ppp_instance.DidDestroy = DidDestroy; |
231 DidCreate, | 231 ppp_instance.DidChangeView = DidChangeView; |
232 DidDestroy, | 232 ppp_instance.DidChangeFocus = DidChangeFocus; |
233 DidChangeView, | 233 ppp_instance.HandleDocumentLoad = HandleDocumentLoad; |
234 DidChangeFocus, | 234 ppp_messaging.HandleMessage = HandleMessage; |
235 HandleDocumentLoad, | |
236 }; | |
237 ppp_instance = local_ppp_instance; | |
238 struct PPP_Messaging_1_0 local_ppp_messaging = { | |
239 HandleMessage, | |
240 }; | |
241 ppp_messaging = local_ppp_messaging; | |
242 | 235 |
243 ppapihook.ppapi_start(&start_funcs); | 236 ppapihook.ppapi_start(&start_funcs); |
244 | 237 |
245 __libnacl_irt_basic.exit(0); | 238 __libnacl_irt_basic.exit(0); |
246 } | 239 } |
OLD | NEW |