diff options
author | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 15:44:48 +0000 |
---|---|---|
committer | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 15:44:48 +0000 |
commit | b2c73f4e4c6fda28f45c1dbd5651d53dab9064f1 (patch) | |
tree | 0f2787510b9d6a396f4ad62835b693be57a9d17b /components/nacl/common | |
parent | 6a7b2a046dfa6a1ce71fdb757e5acbbdc0a464d6 (diff) | |
download | chromium_src-b2c73f4e4c6fda28f45c1dbd5651d53dab9064f1.zip chromium_src-b2c73f4e4c6fda28f45c1dbd5651d53dab9064f1.tar.gz chromium_src-b2c73f4e4c6fda28f45c1dbd5651d53dab9064f1.tar.bz2 |
Support non-SFI mode in NaCl manifest file.
Currently, the flag to enable non-SFI mode is checked just before launching the plugin in the browser process. However, even if the flag is set, we may need to run the plugin in SFI mode.
For example, trivially, if the plugin provides only SFI-mode binary.
To handle such a case, this CL adds entries to NaCl manifest file so that a plugin developer can declare if their plugin provides SFI-mode/non-SFI mode binaries.
In summary, NaCl works in non-SFI mode if;
1) --enable-nacl-nonsfi-mode is set to true, and
2) the plugin provides the binary for non-SFI mode.
So, some checks are moved from the browser to the renderer.
We need similar, but slightly different, a flag for non-SFI mode. Here is the naming rule:
1) enable_nonsfi_mode -> If non-SFI mode is enabled on the browser.
(In more precise, if it is running on supported platform, and --enable-nacl-nonsfi-mode is set)
2) uses_nonsfi_mode -> If the specified plugin should run on non-SFI mode.
This happens when the plugin provides the binary for non-SFI mode, and --enable-nacl-nonsfi-mode
is set.
Note that, in later CLs, we split non-SFI mode nacl_helper from the current nacl_helper with linking it to the newlib.
Then, the uses_nonsfi_mode will become a flag to decide which helper the host should talk to.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3734
TEST=Ran trybot.
Review URL: https://codereview.chromium.org/177113009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/nacl/common')
-rw-r--r-- | components/nacl/common/nacl_host_messages.h | 1 | ||||
-rw-r--r-- | components/nacl/common/nacl_messages.h | 2 | ||||
-rw-r--r-- | components/nacl/common/nacl_types.cc | 4 | ||||
-rw-r--r-- | components/nacl/common/nacl_types.h | 7 |
4 files changed, 10 insertions, 4 deletions
diff --git a/components/nacl/common/nacl_host_messages.h b/components/nacl/common/nacl_host_messages.h index 6918dc4..3a1e447 100644 --- a/components/nacl/common/nacl_host_messages.h +++ b/components/nacl/common/nacl_host_messages.h @@ -24,6 +24,7 @@ IPC_STRUCT_TRAITS_BEGIN(nacl::NaClLaunchParams) IPC_STRUCT_TRAITS_MEMBER(render_view_id) IPC_STRUCT_TRAITS_MEMBER(permission_bits) IPC_STRUCT_TRAITS_MEMBER(uses_irt) + IPC_STRUCT_TRAITS_MEMBER(uses_nonsfi_mode) IPC_STRUCT_TRAITS_MEMBER(enable_dyncode_syscalls) IPC_STRUCT_TRAITS_MEMBER(enable_exception_handling) IPC_STRUCT_TRAITS_MEMBER(enable_crash_throttling) diff --git a/components/nacl/common/nacl_messages.h b/components/nacl/common/nacl_messages.h index bfb8f4b..9f892be 100644 --- a/components/nacl/common/nacl_messages.h +++ b/components/nacl/common/nacl_messages.h @@ -24,7 +24,7 @@ IPC_STRUCT_TRAITS_BEGIN(nacl::NaClStartParams) IPC_STRUCT_TRAITS_MEMBER(enable_ipc_proxy) IPC_STRUCT_TRAITS_MEMBER(uses_irt) IPC_STRUCT_TRAITS_MEMBER(enable_dyncode_syscalls) - IPC_STRUCT_TRAITS_MEMBER(enable_nonsfi_mode) + IPC_STRUCT_TRAITS_MEMBER(uses_nonsfi_mode) IPC_STRUCT_TRAITS_END() //----------------------------------------------------------------------------- diff --git a/components/nacl/common/nacl_types.cc b/components/nacl/common/nacl_types.cc index acd49c0..50ea1b8 100644 --- a/components/nacl/common/nacl_types.cc +++ b/components/nacl/common/nacl_types.cc @@ -14,7 +14,7 @@ NaClStartParams::NaClStartParams() enable_ipc_proxy(false), uses_irt(false), enable_dyncode_syscalls(false), - enable_nonsfi_mode(false) { + uses_nonsfi_mode(false) { } NaClStartParams::~NaClStartParams() { @@ -33,6 +33,7 @@ NaClLaunchParams::NaClLaunchParams(const std::string& manifest_url, int render_view_id, uint32 permission_bits, bool uses_irt, + bool uses_nonsfi_mode, bool enable_dyncode_syscalls, bool enable_exception_handling, bool enable_crash_throttling) @@ -40,6 +41,7 @@ NaClLaunchParams::NaClLaunchParams(const std::string& manifest_url, render_view_id(render_view_id), permission_bits(permission_bits), uses_irt(uses_irt), + uses_nonsfi_mode(uses_nonsfi_mode), enable_dyncode_syscalls(enable_dyncode_syscalls), enable_exception_handling(enable_exception_handling), enable_crash_throttling(enable_crash_throttling) { diff --git a/components/nacl/common/nacl_types.h b/components/nacl/common/nacl_types.h index 29235ec..4adee9d 100644 --- a/components/nacl/common/nacl_types.h +++ b/components/nacl/common/nacl_types.h @@ -60,7 +60,7 @@ struct NaClStartParams { bool enable_ipc_proxy; bool uses_irt; bool enable_dyncode_syscalls; - bool enable_nonsfi_mode; + bool uses_nonsfi_mode; }; // Parameters sent to the browser process to have it launch a NaCl process. @@ -69,7 +69,9 @@ struct NaClStartParams { // nacl_host_messages.h. struct NaClLaunchParams { NaClLaunchParams(); - NaClLaunchParams(const std::string& u, int r, uint32 p, bool uses_irt, + NaClLaunchParams(const std::string& u, int r, uint32 p, + bool uses_irt, + bool uses_nonsfi_mode, bool enable_dyncode_syscalls, bool enable_exception_handling, bool enable_crash_throttling); @@ -80,6 +82,7 @@ struct NaClLaunchParams { int render_view_id; uint32 permission_bits; bool uses_irt; + bool uses_nonsfi_mode; bool enable_dyncode_syscalls; bool enable_exception_handling; bool enable_crash_throttling; |