| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 size_t length, | 86 size_t length, |
| 87 double timeStamp) { | 87 double timeStamp) { |
| 88 DCHECK(isMainThread()); | 88 DCHECK(isMainThread()); |
| 89 | 89 |
| 90 if (!length) | 90 if (!length) |
| 91 return; | 91 return; |
| 92 | 92 |
| 93 if (getConnection() != ConnectionStateOpen) | 93 if (getConnection() != ConnectionStateOpen) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 // Drop sysex message here when the client does not request it. Note that this
is not a security check but an | 96 // Drop sysex message here when the client does not request it. Note that this |
| 97 // automatic filtering for clients that do not want sysex message. Also note t
hat sysex message will never be sent | 97 // is not a security check but an automatic filtering for clients that do not |
| 98 // unless the current process has an explicit permission to handle sysex messa
ge. | 98 // want sysex message. Also note that sysex message will never be sent unless |
| 99 // the current process has an explicit permission to handle sysex message. |
| 99 if (data[0] == 0xf0 && !midiAccess()->sysexEnabled()) | 100 if (data[0] == 0xf0 && !midiAccess()->sysexEnabled()) |
| 100 return; | 101 return; |
| 101 DOMUint8Array* array = DOMUint8Array::create(data, length); | 102 DOMUint8Array* array = DOMUint8Array::create(data, length); |
| 102 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); | 103 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); |
| 103 } | 104 } |
| 104 | 105 |
| 105 DEFINE_TRACE(MIDIInput) { | 106 DEFINE_TRACE(MIDIInput) { |
| 106 MIDIPort::trace(visitor); | 107 MIDIPort::trace(visitor); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |