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

Unified Diff: content/browser/browser_child_process_host_impl.cc

Issue 283313002: Ensure that any IPC sent from a child process that couldn't be deserialized causes that p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: switch to histograms Created 6 years, 7 months 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
Index: content/browser/browser_child_process_host_impl.cc
===================================================================
--- content/browser/browser_child_process_host_impl.cc (revision 270662)
+++ content/browser/browser_child_process_host_impl.cc (working copy)
@@ -219,6 +219,12 @@
BrowserChildProcessInstanceCreated(data));
}
+void BrowserChildProcessHostImpl::HistogramBadMessageTerminated(
+ int process_type) {
+ UMA_HISTOGRAM_ENUMERATION("ChildProcess.BadMessgeTerminated", process_type,
+ PROCESS_TYPE_MAX);
+}
+
base::TerminationStatus BrowserChildProcessHostImpl::GetTerminationStatus(
bool known_dead, int* exit_code) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -252,6 +258,12 @@
delegate_->OnChannelError();
}
+void BrowserChildProcessHostImpl::OnBadMessageReceived(
+ const IPC::Message& message) {
+ HistogramBadMessageTerminated(data_.process_type);
+ base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false);
+}
+
bool BrowserChildProcessHostImpl::CanShutdown() {
return delegate_->CanShutdown();
}
« no previous file with comments | « content/browser/browser_child_process_host_impl.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698