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

Unified Diff: Source/modules/webmidi/MIDIInput.cpp

Issue 23648006: Web MIDI: tentative sysex check for receiving messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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: Source/modules/webmidi/MIDIInput.cpp
diff --git a/Source/modules/webmidi/MIDIInput.cpp b/Source/modules/webmidi/MIDIInput.cpp
index 1e9e62c80095d7bcfaa742d97850f4bb4e8f32a0..5dcb2f9e2bbebe2d552df85b7f9ded66cf7e3d14 100644
--- a/Source/modules/webmidi/MIDIInput.cpp
+++ b/Source/modules/webmidi/MIDIInput.cpp
@@ -30,21 +30,28 @@
#include "config.h"
#include "modules/webmidi/MIDIInput.h"
+
+#include "modules/webmidi/MIDIAccess.h"
#include "modules/webmidi/MIDIMessageEvent.h"
namespace WebCore {
-PassRefPtr<MIDIInput> MIDIInput::create(ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, const String& version)
+PassRefPtr<MIDIInput> MIDIInput::create(MIDIAccess* access, ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, const String& version)
{
- return adoptRef(new MIDIInput(context, id, manufacturer, name, version));
+ return adoptRef(new MIDIInput(access, context, id, manufacturer, name, version));
}
-MIDIInput::MIDIInput(ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, const String& version)
+MIDIInput::MIDIInput(MIDIAccess* access, ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, const String& version)
: MIDIPort(context, id, manufacturer, name, MIDIPortTypeInput, version)
+ , m_access(access)
{
ScriptWrappable::init(this);
}
+MIDIInput::~MIDIInput()
+{
+}
+
void MIDIInput::didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp)
{
ASSERT(isMainThread());
@@ -57,8 +64,8 @@ void MIDIInput::didReceiveMIDIData(unsigned portIndex, const unsigned char* data
unsigned char status = data[i];
unsigned char strippedStatus = status & 0xf0;
- // FIXME: support System Exclusive.
- if (strippedStatus >= 0xf0)
+ // FIXME: integrate sending side filtering and implement more extensive filtering.
+ if (strippedStatus >= 0xf0 && !m_access->sysExEnabled())
break;
// All non System Exclusive messages have a total size of 3 except for Program Change and Channel Pressure.
« Source/modules/webmidi/MIDIAccess.cpp ('K') | « Source/modules/webmidi/MIDIInput.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698