diff options
author | mseaborn <mseaborn@chromium.org> | 2015-01-18 19:48:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-19 03:48:59 +0000 |
commit | 6dce4722943209065ba2c06add74500a764da1b0 (patch) | |
tree | ca5d6dfa6a6f9c0cb05f186a60e3331316b05d23 | |
parent | 5801a144eb6bd3a166a2b883272b480d3479967b (diff) | |
download | chromium_src-6dce4722943209065ba2c06add74500a764da1b0.zip chromium_src-6dce4722943209065ba2c06add74500a764da1b0.tar.gz chromium_src-6dce4722943209065ba2c06add74500a764da1b0.tar.bz2 |
NaCl: Remove reliance on "init_done" SRPC call in the non-PNaCl case (2nd try)
We can remove Plugin::NexeFileDidOpenContinuation(), which gets called
via the "init_done" SRPC call (which calls
StartupInitializationComplete() in plugin/service_runtime.cc).
Its work gets done by the newer
ManifestServiceProxy::StartupInitializationComplete() in
components/nacl/renderer/ppb_nacl_private_impl.cc, which gets called
via Chrome IPC (by the "PpapiHostMsg_StartupInitializationComplete"
message).
This changes the error that's reported when PPP_InitializeModule()
crashes/exits (or returns an error, which prompts an exit), so update
the expectations in NaClBrowserTestNewlib.Bad. (Note that if we
wanted to keep the error message the same, we'd have to reorder when
ppapi_dispatcher.cc sends StartupInitializationComplete *and* make
this a synchronous message.)
Note that PNaCl still relies on "init_done" for now.
BUG=428030
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3864
TEST=NaCl.*Core tests + NaClBrowserTestNewlib.Bad
Review URL: https://codereview.chromium.org/825453005
Cr-Commit-Position: refs/heads/master@{#312065}
-rw-r--r-- | chrome/test/data/nacl/bad/ppapi_bad.html | 4 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.cc | 24 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.h | 1 |
3 files changed, 10 insertions, 19 deletions
diff --git a/chrome/test/data/nacl/bad/ppapi_bad.html b/chrome/test/data/nacl/bad/ppapi_bad.html index d756d5b..72b40ac 100644 --- a/chrome/test/data/nacl/bad/ppapi_bad.html +++ b/chrome/test/data/nacl/bad/ppapi_bad.html @@ -126,7 +126,7 @@ function declareTests(tester) { 'bad_ppp_initialize', 'ppapi_bad_ppp_initialize.nmf', mime_type, - 'NaCl module load failed: could not initialize module.'); + 'NaCl module load failed: Nexe crashed during startup'); // 'bad_ppp_initialize_crash' loads a manifest, then loads a nexe that crashes // before initializing PPAPI module @@ -135,7 +135,7 @@ function declareTests(tester) { 'bad_ppp_initialize_crash', 'ppapi_bad_ppp_initialize_crash.nmf', mime_type, - 'NaCl module load failed: could not initialize module.'); + 'NaCl module load failed: Nexe crashed during startup'); // 'bad_no_ppp_instance' loads a manifest, then loads a nexe that fails to // get the required PPP_Instance interface diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 31be5e2..177b3ce 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -309,22 +309,8 @@ void Plugin::NexeFileDidOpen(int32_t pp_error) { nexe_file_info_, uses_nonsfi_mode_, PP_NATIVE_NACL_PROCESS_TYPE, - callback_factory_.NewCallback(&Plugin::NexeFileDidOpenContinuation)); -} - -void Plugin::NexeFileDidOpenContinuation(int32_t pp_error) { - UNREFERENCED_PARAMETER(pp_error); - NaClLog(4, "Entered NexeFileDidOpenContinuation\n"); - if (LoadNaClModuleContinuationIntern()) { - NaClLog(4, "NexeFileDidOpenContinuation: success;" - " setting histograms\n"); - int64_t nexe_size = nacl_interface_->GetNexeSize(pp_instance()); - nacl_interface_->ReportLoadSuccess( - pp_instance(), nexe_size, nexe_size); - } else { - NaClLog(4, "NexeFileDidOpenContinuation: failed."); - } - NaClLog(4, "Leaving NexeFileDidOpenContinuation\n"); + // No-op callback. + pp::CompletionCallback()); } void Plugin::BitcodeDidTranslate(int32_t pp_error) { @@ -349,6 +335,12 @@ void Plugin::BitcodeDidTranslate(int32_t pp_error) { callback_factory_.NewCallback(&Plugin::BitcodeDidTranslateContinuation)); } +// This is the only code path that responds to the +// "init_done"/StartupInitializationComplete() SRPC call, which now has an +// effect for PNaCl only. +// TODO(mseaborn): Switch to doing this ReportLoadSuccess() call via the +// Chrome-IPC-based StartupInitializationComplete() handler in +// ppb_nacl_private_impl.cc, to match the non-PNaCl cases. void Plugin::BitcodeDidTranslateContinuation(int32_t pp_error) { NaClLog(4, "Entered BitcodeDidTranslateContinuation\n"); UNREFERENCED_PARAMETER(pp_error); diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h index 1fe082a..4b90ec6 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.h +++ b/ppapi/native_client/src/trusted/plugin/plugin.h @@ -158,7 +158,6 @@ class Plugin : public pp::Instance { // is successful, the file descriptor is opened and can be passed to sel_ldr // with the sandbox on. void NexeFileDidOpen(int32_t pp_error); - void NexeFileDidOpenContinuation(int32_t pp_error); // Callback used when a .nexe is translated from bitcode. If the translation // is successful, the file descriptor is opened and can be passed to sel_ldr |