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

Unified Diff: content/browser/media/midi_host.cc

Issue 1145013004: Introduce bad_message.h for chrome and NaCl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/media/midi_host.cc
diff --git a/content/browser/media/midi_host.cc b/content/browser/media/midi_host.cc
index 721095e0bc3f67d720c7206c2174f3ba99cc9bcf..d610025454cd15ba4343e195cdad4997515f7ced 100644
--- a/content/browser/media/midi_host.cc
+++ b/content/browser/media/midi_host.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/process/process.h"
#include "base/trace_event/trace_event.h"
+#include "content/browser/bad_message.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/media/media_internals.h"
@@ -92,8 +93,7 @@ void MidiHost::OnSendData(uint32 port,
{
base::AutoLock auto_lock(output_port_count_lock_);
if (output_port_count_ <= port) {
- RecordAction(base::UserMetricsAction("BadMessageTerminate_MIDIPort"));
- BadMessageReceived();
+ bad_message::ReceivedBadMessage(this, bad_message::MH_INVALID_MIDI_PORT);
return;
}
}
@@ -106,8 +106,7 @@ void MidiHost::OnSendData(uint32 port,
// happens here in the browser process.
if (!has_sys_ex_permission_ &&
std::find(data.begin(), data.end(), kSysExByte) != data.end()) {
- RecordAction(base::UserMetricsAction("BadMessageTerminate_MIDI"));
- BadMessageReceived();
+ bad_message::ReceivedBadMessage(this, bad_message::MH_SYS_EX_PERMISSION);
return;
}
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/media/midi_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698