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

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

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working patch Created 6 years, 10 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/media/midi_host.cc
diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc
index b6e26886db7902bbd0071a9bea3f86cc0f387b00..c1f9f63a84f2e75d4741df36f2b778bba02a41bf 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -35,6 +35,10 @@ const size_t kMaxInFlightBytes = 10 * 1024 * 1024; // 10 MB.
// how many bytes will be sent before reporting back to the renderer.
const size_t kAcknowledgementThresholdBytes = 1024 * 1024; // 1 MB.
+const uint32 kFilteredMessageClasses[] = {
+ MidiMsgStart,
+};
+
bool IsDataByte(uint8 data) {
return (data & 0x80) == 0;
}
@@ -49,7 +53,9 @@ using media::kSysExByte;
using media::kEndOfSysExByte;
MidiHost::MidiHost(int renderer_process_id, media::MidiManager* midi_manager)
- : renderer_process_id_(renderer_process_id),
+ : BrowserMessageFilter(
+ kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
+ renderer_process_id_(renderer_process_id),
has_sys_ex_permission_(false),
midi_manager_(midi_manager),
sent_bytes_in_flight_(0),

Powered by Google App Engine
This is Rietveld 408576698