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(); |
} |