Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6593)

Unified Diff: chrome/browser/zygote_main_linux.cc

Issue 5172009: This adds some plumbing for propagating the reason for a renderer's death (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final review changes Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/zygote_host_linux.cc ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/zygote_main_linux.cc
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index 5943d11097d12cef3c3c3c27719afb53db02f615..1b26a6b4980b145bae224042aa18404d1bbdecee 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -41,6 +41,7 @@
#include "chrome/common/main_function_params.h"
#include "chrome/common/pepper_plugin_registry.h"
#include "chrome/common/process_watcher.h"
+#include "chrome/common/result_codes.h"
#include "chrome/common/sandbox_methods_linux.h"
#include "media/base/media.h"
@@ -167,10 +168,10 @@ class Zygote {
break;
HandleReapRequest(fd, pickle, iter);
return false;
- case ZygoteHost::kCmdDidProcessCrash:
+ case ZygoteHost::kCmdGetTerminationStatus:
if (!fds.empty())
break;
- HandleDidProcessCrash(fd, pickle, iter);
+ HandleGetTerminationStatus(fd, pickle, iter);
return false;
case ZygoteHost::kCmdGetSandboxStatus:
HandleGetSandboxStatus(fd, pickle, iter);
@@ -209,26 +210,31 @@ class Zygote {
ProcessWatcher::EnsureProcessTerminated(actual_child);
}
- void HandleDidProcessCrash(int fd, const Pickle& pickle, void* iter) {
+ void HandleGetTerminationStatus(int fd, const Pickle& pickle, void* iter) {
base::ProcessHandle child;
if (!pickle.ReadInt(&iter, &child)) {
- LOG(WARNING) << "Error parsing DidProcessCrash request from browser";
+ LOG(WARNING) << "Error parsing GetTerminationStatus request "
+ << "from browser";
return;
}
- bool child_exited;
- bool did_crash;
+ base::TerminationStatus status;
+ int exit_code;
if (g_suid_sandbox_active)
child = real_pids_to_sandbox_pids[child];
- if (child)
- did_crash = base::DidProcessCrash(&child_exited, child);
- else
- did_crash = child_exited = false;
+ if (child) {
+ status = base::GetTerminationStatus(child, &exit_code);
+ } else {
+ // Assume that if we can't find the child in the sandbox, then
+ // it terminated normally.
+ status = base::TERMINATION_STATUS_NORMAL_TERMINATION;
+ exit_code = ResultCodes::NORMAL_EXIT;
+ }
Pickle write_pickle;
- write_pickle.WriteBool(did_crash);
- write_pickle.WriteBool(child_exited);
+ write_pickle.WriteInt(static_cast<int>(status));
+ write_pickle.WriteInt(exit_code);
if (HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size())) !=
write_pickle.size()) {
PLOG(ERROR) << "write";
« no previous file with comments | « chrome/browser/zygote_host_linux.cc ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698