OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 // We need nacl_irt_start injection in SFI mode. Non-SFI has a different | 7 // We need nacl_irt_start injection in SFI mode. Non-SFI has a different |
8 // start up procedure so we just exclude it. | 8 // start up procedure so we just exclude it. |
9 #if defined(OS_NACL_SFI) | 9 #if defined(OS_NACL_SFI) |
10 | 10 |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "native_client/src/public/chrome_main.h" | 12 #include "native_client/src/public/chrome_main.h" |
13 #include "native_client/src/public/irt_core.h" | 13 #include "native_client/src/public/irt_core.h" |
14 #include "ppapi/nacl_irt/irt_ppapi.h" | 14 #include "ppapi/nacl_irt/irt_interfaces.h" |
15 #include "ppapi/nacl_irt/plugin_startup.h" | 15 #include "ppapi/nacl_irt/plugin_startup.h" |
16 | 16 |
17 void nacl_irt_start(uint32_t* info) { | 17 void nacl_irt_start(uint32_t* info) { |
18 nacl_irt_init(info); | 18 nacl_irt_init(info); |
19 | 19 |
20 // Though it isn't referenced here, we must instantiate an AtExitManager. | 20 // Though it isn't referenced here, we must instantiate an AtExitManager. |
21 base::AtExitManager exit_manager; | 21 base::AtExitManager exit_manager; |
22 | 22 |
23 // In SFI mode, the FDs of IPC channels are NACL_CHROME_DESC_BASE and its | 23 // In SFI mode, the FDs of IPC channels are NACL_CHROME_DESC_BASE and its |
24 // successor, which is set in nacl_listener.cc. | 24 // successor, which is set in nacl_listener.cc. |
25 ppapi::SetIPCFileDescriptors( | 25 ppapi::SetIPCFileDescriptors( |
26 NACL_CHROME_DESC_BASE, | 26 NACL_CHROME_DESC_BASE, |
27 NACL_CHROME_DESC_BASE + 1, | 27 NACL_CHROME_DESC_BASE + 1, |
28 NACL_CHROME_DESC_BASE + 2); | 28 NACL_CHROME_DESC_BASE + 2); |
29 ppapi::StartUpPlugin(); | 29 ppapi::StartUpPlugin(); |
30 | 30 |
31 nacl_irt_enter_user_code(info, chrome_irt_query); | 31 nacl_irt_enter_user_code(info, chrome_irt_query); |
32 } | 32 } |
33 | 33 |
34 #endif // defined(OS_NACL_SFI) | 34 #endif // defined(OS_NACL_SFI) |
OLD | NEW |