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

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: sync 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)
@@ -25,6 +25,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
#include "content/public/common/result_codes.h"
@@ -252,6 +253,17 @@
delegate_->OnChannelError();
}
+void BrowserChildProcessHostImpl::OnBadMessageReceived(
+ const IPC::Message& message) {
+ std::string action_name = std::string("BadMessageTerminate_") +
+ GetProcessTypeNameInEnglish(data_.process_type);
+ // The English name of a process type sometimes has spaces. Remove them since
Tom Sepez 2014/05/15 19:57:42 Maybe we want to add GetProcessTypeNameForUMA() ra
jam 2014/05/15 21:19:34 i prefer not adding yet another way of getting a n
+ // UMA action names don't contain whitespaces.
+ base::RemoveChars(action_name, " ", &action_name);
+ RecordAction(base::UserMetricsAction(action_name.c_str()));
+ base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false);
+}
+
bool BrowserChildProcessHostImpl::CanShutdown() {
return delegate_->CanShutdown();
}

Powered by Google App Engine
This is Rietveld 408576698