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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1009583004: Add UMA histograms and logging for bad IPC message handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: actions.xml claims to be pretty printed Created 5 years, 9 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/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 1ab2a20a4d35323f8282f36852cd9da5688605a4..95f906cb7e1d68d5f0849bfaf2a97a0082411d77 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -26,6 +26,7 @@
#include "cc/output/compositor_frame_ack.h"
#include "content/browser/accessibility/accessibility_mode_helper.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
+#include "content/browser/bad_message.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/gpu/gpu_process_host.h"
@@ -57,7 +58,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_widget_host_iterator.h"
-#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
@@ -1600,8 +1600,8 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture(
// Only allow untrustworthy gestures if explicitly enabled.
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
cc::switches::kEnableGpuBenchmarking)) {
- RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH7"));
- GetProcess()->ReceivedBadMessage();
+ bad_message::ReceivedBadMessage(GetProcess(),
+ bad_message::RWH_SYNTHETIC_GESTURE);
return;
}
@@ -1613,14 +1613,12 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture(
void RenderWidgetHostImpl::OnFocus() {
// Only RenderViewHost can deal with that message.
- RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH4"));
- GetProcess()->ReceivedBadMessage();
+ bad_message::ReceivedBadMessage(GetProcess(), bad_message::RWH_FOCUS);
}
void RenderWidgetHostImpl::OnBlur() {
// Only RenderViewHost can deal with that message.
- RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5"));
- GetProcess()->ReceivedBadMessage();
+ bad_message::ReceivedBadMessage(GetProcess(), bad_message::RWH_BLUR);
}
void RenderWidgetHostImpl::OnSetCursor(const WebCursor& cursor) {
@@ -1695,8 +1693,8 @@ void RenderWidgetHostImpl::OnShowDisambiguationPopup(
scoped_ptr<cc::SharedBitmap> bitmap =
HostSharedBitmapManager::current()->GetSharedBitmapFromId(size, id);
if (!bitmap) {
- RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH6"));
- GetProcess()->ReceivedBadMessage();
+ bad_message::ReceivedBadMessage(GetProcess(),
+ bad_message::RWH_SHARED_BITMAP);
return;
}
@@ -1891,8 +1889,7 @@ void RenderWidgetHostImpl::OnTouchEventAck(
void RenderWidgetHostImpl::OnUnexpectedEventAck(UnexpectedEventAckType type) {
if (type == BAD_ACK_MESSAGE) {
- RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH2"));
- process_->ReceivedBadMessage();
+ bad_message::ReceivedBadMessage(process_, bad_message::RWH_BAD_ACK_MESSAGE);
} else if (type == UNEXPECTED_EVENT_TYPE) {
suppress_next_char_events_ = false;
}
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698