Bug 671196: Kill content processes that cause processing errors in the chrome process. r=bsmedberg

This commit is contained in:
Chris Jones 2011-07-12 23:52:31 -07:00
parent 54e8134b81
commit 6ec5bd9705
2 changed files with 24 additions and 0 deletions

View File

@ -13,6 +13,8 @@
# include <sys/resource.h>
#endif
#include "chrome/common/process_watcher.h"
#include "CrashReporterParent.h"
#include "History.h"
#include "IDBFactory.h"
@ -332,6 +334,26 @@ ContentParent::OnChannelConnected(int32 pid)
}
}
void
ContentParent::ProcessingError(Result what)
{
if (MsgDropped == what) {
// Messages sent after crashes etc. are not a big deal.
return;
}
// Other errors are big deals. This ensures the process is
// eventually killed, but doesn't immediately KILLITWITHFIRE
// because we want to get a minidump if possible. After a timeout
// though, the process is forceably killed.
if (!KillProcess(OtherProcess(), 1, false)) {
NS_WARNING("failed to kill subprocess!");
}
XRE_GetIOMessageLoop()->PostTask(
FROM_HERE,
NewRunnableFunction(&ProcessWatcher::EnsureProcessTerminated,
OtherProcess(), /*force=*/true));
}
namespace {
void

View File

@ -262,6 +262,8 @@ private:
virtual bool RecvAddFileWatch(const nsString& root);
virtual bool RecvRemoveFileWatch(const nsString& root);
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
GeckoChildProcessHost* mSubprocess;
PRInt32 mGeolocationWatchID;