| Index: content/browser/renderer_host/render_process_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
| index fd8d6625f60abc5273aa5feac1de29f59df3bbd2..e9fc5c15fc3f66afccd82871d787030de5bf1b04 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -972,9 +972,7 @@ bool RenderProcessHostImpl::Init() {
|
| child_process_launcher_.reset(new ChildProcessLauncher(
|
| new RendererSandboxedProcessLauncherDelegate(channel_.get()), cmd_line,
|
| GetID(), this, child_token_,
|
| - base::Bind(&RenderProcessHostImpl::OnMojoError,
|
| - weak_factory_.GetWeakPtr(),
|
| - base::ThreadTaskRunnerHandle::Get())));
|
| + base::Bind(&RenderProcessHostImpl::OnMojoError, id_)));
|
| channel_->Pause();
|
|
|
| fast_shutdown_started_ = false;
|
| @@ -1463,7 +1461,8 @@ void RenderProcessHostImpl::RemoveObserver(
|
| observers_.RemoveObserver(observer);
|
| }
|
|
|
| -void RenderProcessHostImpl::ShutdownForBadMessage() {
|
| +void RenderProcessHostImpl::ShutdownForBadMessage(
|
| + CrashReportMode crash_report_mode) {
|
| base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC))
|
| return;
|
| @@ -1478,8 +1477,10 @@ void RenderProcessHostImpl::ShutdownForBadMessage() {
|
| // browser to try to survive when it gets illegal messages from the renderer.
|
| Shutdown(RESULT_CODE_KILLED_BAD_MESSAGE, false);
|
|
|
| - // Report a crash, since none will be generated by the killed renderer.
|
| - base::debug::DumpWithoutCrashing();
|
| + if (crash_report_mode == CrashReportMode::GENERATE_CRASH_DUMP) {
|
| + // Report a crash, since none will be generated by the killed renderer.
|
| + base::debug::DumpWithoutCrashing();
|
| + }
|
|
|
| // Log the renderer kill to the histogram tracking all kills.
|
| BrowserChildProcessHostImpl::HistogramBadMessageTerminated(
|
| @@ -3031,24 +3032,14 @@ void RenderProcessHostImpl::RecomputeAndUpdateWebKitPreferences() {
|
| }
|
|
|
| // static
|
| -void RenderProcessHostImpl::OnMojoError(
|
| - base::WeakPtr<RenderProcessHostImpl> process,
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| - const std::string& error) {
|
| - if (!task_runner->BelongsToCurrentThread()) {
|
| - task_runner->PostTask(FROM_HERE,
|
| - base::Bind(&RenderProcessHostImpl::OnMojoError,
|
| - process, task_runner, error));
|
| - return;
|
| - }
|
| - if (!process)
|
| - return;
|
| +void RenderProcessHostImpl::OnMojoError(int render_process_id,
|
| + const std::string& error) {
|
| LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
|
|
|
| // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
|
| // enough information here so that we can determine what the bad message was.
|
| base::debug::Alias(&error);
|
| - bad_message::ReceivedBadMessage(process.get(),
|
| + bad_message::ReceivedBadMessage(render_process_id,
|
| bad_message::RPH_MOJO_PROCESS_ERROR);
|
| }
|
|
|
|
|