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

Unified Diff: media/midi/midi_message_util.h

Issue 68353002: Use MIDIMessageQueue/IsValidWebMIDIData for MIDI byte stream validation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary notation from a header comment, to address scherkus' comment. Created 7 years, 1 month 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
« no previous file with comments | « media/midi/midi_message_queue_unittest.cc ('k') | media/midi/midi_message_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_message_util.h
diff --git a/media/midi/midi_message_util.h b/media/midi/midi_message_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..dfe66ecfcd32910cd65dc94dc095468980255cc9
--- /dev/null
+++ b/media/midi/midi_message_util.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MIDI_MIDI_MESSAGE_UTIL_H_
+#define MEDIA_MIDI_MIDI_MESSAGE_UTIL_H_
+
+#include <deque>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+// Returns the length of a MIDI message in bytes. Never returns 4 or greater.
+// Returns 0 if |status_byte| is:
+// - not a valid status byte, namely data byte.
+// - the MIDI System Exclusive message.
+// - the End of System Exclusive message.
+MEDIA_EXPORT size_t GetMIDIMessageLength(uint8 status_byte);
+
+} // namespace media
+
+#endif // MEDIA_MIDI_MIDI_MESSAGE_UTIL_H_
« no previous file with comments | « media/midi/midi_message_queue_unittest.cc ('k') | media/midi/midi_message_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698