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 start_funcs.PPP_InitializeModule = MyPPP_InitializeModule; | 225 MyPPP_InitializeModule, |
226 start_funcs.PPP_ShutdownModule = MyPPP_ShutdownModule; | 226 MyPPP_ShutdownModule, |
227 start_funcs.PPP_GetInterface = MyPPP_GetInterface; | 227 MyPPP_GetInterface, |
228 /* Similarly, initialize some global variables, avoiding relocations. */ | 228 }; |
229 ppp_instance.DidCreate = DidCreate; | 229 /* Similarly, initialise some global variables, avoiding relocations. */ |
230 ppp_instance.DidDestroy = DidDestroy; | 230 struct PPP_Instance_1_0 local_ppp_instance = { |
231 ppp_instance.DidChangeView = DidChangeView; | 231 DidCreate, |
232 ppp_instance.DidChangeFocus = DidChangeFocus; | 232 DidDestroy, |
233 ppp_instance.HandleDocumentLoad = HandleDocumentLoad; | 233 DidChangeView, |
234 ppp_messaging.HandleMessage = HandleMessage; | 234 DidChangeFocus, |
| 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; |
235 | 242 |
236 ppapihook.ppapi_start(&start_funcs); | 243 ppapihook.ppapi_start(&start_funcs); |
237 | 244 |
238 __libnacl_irt_basic.exit(0); | 245 __libnacl_irt_basic.exit(0); |
239 } | 246 } |
OLD | NEW |