Commit 974353f6 authored by hidehiko@chromium.org's avatar hidehiko@chromium.org

Remove redundant use_nonsfi_mode from SelLdrStartParams.

The params is used for ServiceRuntime::StartSelLdr(). ServiceRuntime
already knows if it is for nonsfi or not. So the use_nonsfi_mode in
SelLdrStartParams is just redundant. Remove it.

BUG=333950
TEST=Ran browser_tests --gtest_filter=*NonSfi*:*NonSFI* locally, and trybots.
CQ_EXTRA_TRYBOTS=tryserver.chromium:linux_rel_precise32

Review URL: https://codereview.chromium.org/332333003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277864 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d26103f
...@@ -66,16 +66,17 @@ void Plugin::HistogramTimeSmall(const std::string& name, ...@@ -66,16 +66,17 @@ void Plugin::HistogramTimeSmall(const std::string& name,
kTimeSmallBuckets); kTimeSmallBuckets);
} }
bool Plugin::LoadNaClModuleFromBackgroundThread( bool Plugin::LoadHelperNaClModule(PP_FileHandle file_handle,
PP_FileHandle file_handle, NaClSubprocess* subprocess,
NaClSubprocess* subprocess, const SelLdrStartParams& params) {
const SelLdrStartParams& params) {
CHECK(!pp::Module::Get()->core()->IsMainThread()); CHECK(!pp::Module::Get()->core()->IsMainThread());
ServiceRuntime* service_runtime = ServiceRuntime* service_runtime =
new ServiceRuntime(this, false, uses_nonsfi_mode_, new ServiceRuntime(this,
false, // No main_service_runtime.
false, // No non-SFI mode (i.e. in SFI-mode).
pp::BlockUntilComplete(), pp::BlockUntilComplete()); pp::BlockUntilComplete(), pp::BlockUntilComplete());
subprocess->set_service_runtime(service_runtime); subprocess->set_service_runtime(service_runtime);
PLUGIN_PRINTF(("Plugin::LoadNaClModuleFromBackgroundThread " PLUGIN_PRINTF(("Plugin::LoadHelperNaClModule "
"(service_runtime=%p)\n", "(service_runtime=%p)\n",
static_cast<void*>(service_runtime))); static_cast<void*>(service_runtime)));
...@@ -91,12 +92,11 @@ bool Plugin::LoadNaClModuleFromBackgroundThread( ...@@ -91,12 +92,11 @@ bool Plugin::LoadNaClModuleFromBackgroundThread(
sel_ldr_callback); sel_ldr_callback);
pp::Module::Get()->core()->CallOnMainThread(0, callback, 0); pp::Module::Get()->core()->CallOnMainThread(0, callback, 0);
if (!service_runtime->WaitForSelLdrStart()) { if (!service_runtime->WaitForSelLdrStart()) {
PLUGIN_PRINTF(("Plugin::LoadNaClModuleFromBackgroundThread " PLUGIN_PRINTF(("Plugin::LoadHelperNaClModule "
"WaitForSelLdrStart timed out!\n")); "WaitForSelLdrStart timed out!\n"));
return false; return false;
} }
PLUGIN_PRINTF(("Plugin::LoadNaClModuleFromBackgroundThread " PLUGIN_PRINTF(("Plugin::LoadHelperNaClModule (service_runtime_started=%d)\n",
"(service_runtime_started=%d)\n",
service_runtime_started)); service_runtime_started));
if (!service_runtime_started) if (!service_runtime_started)
return false; return false;
...@@ -170,14 +170,12 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info, ...@@ -170,14 +170,12 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
SelLdrStartParams params(manifest_base_url_str, SelLdrStartParams params(manifest_base_url_str,
true /* uses_irt */, true /* uses_irt */,
true /* uses_ppapi */, true /* uses_ppapi */,
uses_nonsfi_mode,
enable_dyncode_syscalls, enable_dyncode_syscalls,
enable_exception_handling, enable_exception_handling,
enable_crash_throttling); enable_crash_throttling);
ErrorInfo error_info; ErrorInfo error_info;
ServiceRuntime* service_runtime = ServiceRuntime* service_runtime = new ServiceRuntime(
new ServiceRuntime(this, true, uses_nonsfi_mode, this, true, uses_nonsfi_mode, init_done_cb, crash_cb);
init_done_cb, crash_cb);
main_subprocess_.set_service_runtime(service_runtime); main_subprocess_.set_service_runtime(service_runtime);
PLUGIN_PRINTF(("Plugin::LoadNaClModule (service_runtime=%p)\n", PLUGIN_PRINTF(("Plugin::LoadNaClModule (service_runtime=%p)\n",
static_cast<void*>(service_runtime))); static_cast<void*>(service_runtime)));
...@@ -251,15 +249,13 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url, ...@@ -251,15 +249,13 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url,
SelLdrStartParams params(helper_url, SelLdrStartParams params(helper_url,
false /* uses_irt */, false /* uses_irt */,
false /* uses_ppapi */, false /* uses_ppapi */,
false /* uses_nonsfi_mode */,
false /* enable_dyncode_syscalls */, false /* enable_dyncode_syscalls */,
false /* enable_exception_handling */, false /* enable_exception_handling */,
true /* enable_crash_throttling */); true /* enable_crash_throttling */);
// Helper NaCl modules always use the PNaCl manifest, as there is no // Helper NaCl modules always use the PNaCl manifest, as there is no
// corresponding NMF. // corresponding NMF.
if (!LoadNaClModuleFromBackgroundThread(file_handle, nacl_subprocess.get(), if (!LoadHelperNaClModule(file_handle, nacl_subprocess.get(), params)) {
params)) {
return NULL; return NULL;
} }
// We need not wait for the init_done callback. We can block // We need not wait for the init_done callback. We can block
......
...@@ -141,11 +141,12 @@ class Plugin : public pp::Instance { ...@@ -141,11 +141,12 @@ class Plugin : public pp::Instance {
void HistogramTimeSmall(const std::string& name, int64_t ms); void HistogramTimeSmall(const std::string& name, int64_t ms);
// Load a nacl module from the file specified in file_handle. // Load a nacl module from the file specified in file_handle.
// Only to be used from a background (non-main) thread. // Only to be used from a background (non-main) thread for the PNaCl
// This will fully initialize the |subprocess| if the load was successful. // translator. This will fully initialize the |subprocess| if the load was
bool LoadNaClModuleFromBackgroundThread(PP_FileHandle file_handle, // successful.
NaClSubprocess* subprocess, bool LoadHelperNaClModule(PP_FileHandle file_handle,
const SelLdrStartParams& params); NaClSubprocess* subprocess,
const SelLdrStartParams& params);
// Start sel_ldr from the main thread, given the start params. // Start sel_ldr from the main thread, given the start params.
// |pp_error| is set by CallOnMainThread (should be PP_OK). // |pp_error| is set by CallOnMainThread (should be PP_OK).
......
...@@ -702,7 +702,7 @@ void ServiceRuntime::StartSelLdr(const SelLdrStartParams& params, ...@@ -702,7 +702,7 @@ void ServiceRuntime::StartSelLdr(const SelLdrStartParams& params,
params.url.c_str(), params.url.c_str(),
params.uses_irt, params.uses_irt,
params.uses_ppapi, params.uses_ppapi,
params.uses_nonsfi_mode, uses_nonsfi_mode_,
enable_dev_interfaces, enable_dev_interfaces,
params.enable_dyncode_syscalls, params.enable_dyncode_syscalls,
params.enable_exception_handling, params.enable_exception_handling,
......
...@@ -45,14 +45,12 @@ struct SelLdrStartParams { ...@@ -45,14 +45,12 @@ struct SelLdrStartParams {
SelLdrStartParams(const nacl::string& url, SelLdrStartParams(const nacl::string& url,
bool uses_irt, bool uses_irt,
bool uses_ppapi, bool uses_ppapi,
bool uses_nonsfi_mode,
bool enable_dyncode_syscalls, bool enable_dyncode_syscalls,
bool enable_exception_handling, bool enable_exception_handling,
bool enable_crash_throttling) bool enable_crash_throttling)
: url(url), : url(url),
uses_irt(uses_irt), uses_irt(uses_irt),
uses_ppapi(uses_ppapi), uses_ppapi(uses_ppapi),
uses_nonsfi_mode(uses_nonsfi_mode),
enable_dyncode_syscalls(enable_dyncode_syscalls), enable_dyncode_syscalls(enable_dyncode_syscalls),
enable_exception_handling(enable_exception_handling), enable_exception_handling(enable_exception_handling),
enable_crash_throttling(enable_crash_throttling) { enable_crash_throttling(enable_crash_throttling) {
...@@ -60,7 +58,6 @@ struct SelLdrStartParams { ...@@ -60,7 +58,6 @@ struct SelLdrStartParams {
nacl::string url; nacl::string url;
bool uses_irt; bool uses_irt;
bool uses_ppapi; bool uses_ppapi;
bool uses_nonsfi_mode;
bool enable_dev_interfaces; bool enable_dev_interfaces;
bool enable_dyncode_syscalls; bool enable_dyncode_syscalls;
bool enable_exception_handling; bool enable_exception_handling;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment