Commit ec66f0e4 authored by mseaborn's avatar mseaborn Committed by Commit bot

Revert of NaCl: Remove reliance on "init_done" SRPC call in the non-PNaCl case...

Revert of NaCl: Remove reliance on "init_done" SRPC call in the non-PNaCl case (patchset #4 id:60001 of https://codereview.chromium.org/849523002/)

Reason for revert:
The change appears to cause NaClBrowserTestNewlib.Bad to become flaky.

The flakiness was reported in:
BUG=448596

Original change description:
> NaCl: Remove reliance on "init_done" SRPC call in the non-PNaCl case
>
> 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).
>
> ppapi_dispatcher.cc: In order to keep the error handling tests in
> NaClBrowserTestNewlib.Bad passing, send the
> StartupInitializationComplete message earlier, before we call
> PPP_InitializeModule().  This ensures that crashes in
> PPP_InitializeModule() are reported properly.
>
> Note that PNaCl still relies on "init_done" for now.
>
> BUG=428030
> BUG=https://code.google.com/p/nativeclient/issues/detail?id=3864
>
> Committed: https://crrev.com/4c03d4d0964b0b69f5741aac6c78557b415617e1
> Cr-Commit-Position: refs/heads/master@{#311298}

BUG=428030
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3864

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

Cr-Commit-Position: refs/heads/master@{#311495}
parent 8dac5e5b
......@@ -182,11 +182,6 @@ void PpapiDispatcher::OnMsgInitializeNaClDispatcher(
// plugin.
proxy::InterfaceList::SetProcessGlobalPermissions(args.permissions);
// Notify the renderer process, if necessary.
ManifestService* manifest_service = GetManifestService();
if (manifest_service)
manifest_service->StartupInitializationComplete();
int32_t error = ::PPP_InitializeModule(
0 /* module */,
&proxy::PluginDispatcher::GetBrowserInterface);
......@@ -206,6 +201,11 @@ void PpapiDispatcher::OnMsgInitializeNaClDispatcher(
}
// From here, the dispatcher will manage its own lifetime according to the
// lifetime of the attached channel.
// Notify the renderer process, if necessary.
ManifestService* manifest_service = GetManifestService();
if (manifest_service)
manifest_service->StartupInitializationComplete();
}
void PpapiDispatcher::OnPluginDispatcherMessageReceived(
......
......@@ -309,8 +309,22 @@ void Plugin::NexeFileDidOpen(int32_t pp_error) {
nexe_file_info_,
uses_nonsfi_mode_,
PP_NATIVE_NACL_PROCESS_TYPE,
// No-op callback.
pp::CompletionCallback());
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");
}
void Plugin::BitcodeDidTranslate(int32_t pp_error) {
......@@ -335,12 +349,6 @@ 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);
......
......@@ -158,6 +158,7 @@ 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
......
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