mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 671196: Kill content processes that cause processing errors in the chrome process. r=bsmedberg
This commit is contained in:
parent
cd006a7563
commit
75f3c6e5e7
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user