diff options
Diffstat (limited to 'chrome/browser/zygote_host_linux.cc')
-rw-r--r-- | chrome/browser/zygote_host_linux.cc | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc index f88c597..d88c9be 100644 --- a/chrome/browser/zygote_host_linux.cc +++ b/chrome/browser/zygote_host_linux.cc @@ -306,18 +306,13 @@ void ZygoteHost::EnsureProcessTerminated(pid_t process) { PLOG(ERROR) << "write"; } -base::TerminationStatus ZygoteHost::GetTerminationStatus( - base::ProcessHandle handle, - int* exit_code) { +bool ZygoteHost::DidProcessCrash(base::ProcessHandle handle, + bool* child_exited) { DCHECK(init_); Pickle pickle; - pickle.WriteInt(kCmdGetTerminationStatus); + pickle.WriteInt(kCmdDidProcessCrash); pickle.WriteInt(handle); - // Set this now to handle the early termination cases. - if (exit_code) - *exit_code = 0; - static const unsigned kMaxMessageLength = 128; char buf[kMaxMessageLength]; ssize_t len; @@ -331,23 +326,23 @@ base::TerminationStatus ZygoteHost::GetTerminationStatus( if (len == -1) { LOG(WARNING) << "Error reading message from zygote: " << errno; - return base::TERMINATION_STATUS_NORMAL_TERMINATION; + return false; } else if (len == 0) { LOG(WARNING) << "Socket closed prematurely."; - return base::TERMINATION_STATUS_NORMAL_TERMINATION; + return false; } Pickle read_pickle(buf, len); - int status, tmp_exit_code; + bool did_crash, tmp_child_exited; void* iter = NULL; - if (!read_pickle.ReadInt(&iter, &status) || - !read_pickle.ReadInt(&iter, &tmp_exit_code)) { - LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; - return base::TERMINATION_STATUS_NORMAL_TERMINATION; + if (!read_pickle.ReadBool(&iter, &did_crash) || + !read_pickle.ReadBool(&iter, &tmp_child_exited)) { + LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; + return false; } - if (exit_code) - *exit_code = tmp_exit_code; + if (child_exited) + *child_exited = tmp_child_exited; - return static_cast<base::TerminationStatus>(status); + return did_crash; } |