| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 m_access->sendMIDIData(m_portIndex, data, length, timestamp); | 74 m_access->sendMIDIData(m_portIndex, data, length, timestamp); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void MIDIOutput::send(Vector<unsigned> unsignedData, double timestamp, Exception
State& es) | 77 void MIDIOutput::send(Vector<unsigned> unsignedData, double timestamp, Exception
State& es) |
| 78 { | 78 { |
| 79 RefPtr<Uint8Array> array = Uint8Array::create(unsignedData.size()); | 79 RefPtr<Uint8Array> array = Uint8Array::create(unsignedData.size()); |
| 80 | 80 |
| 81 for (size_t i = 0; i < unsignedData.size(); ++i) { | 81 for (size_t i = 0; i < unsignedData.size(); ++i) { |
| 82 if (unsignedData[i] > 0xff) { | 82 if (unsignedData[i] > 0xff) { |
| 83 es.throwDOMException(InvalidStateError); | 83 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 unsigned char value = unsignedData[i] & 0xff; | 86 unsigned char value = unsignedData[i] & 0xff; |
| 87 array->set(i, value); | 87 array->set(i, value); |
| 88 } | 88 } |
| 89 | 89 |
| 90 send(array.get(), timestamp, es); | 90 send(array.get(), timestamp, es); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void MIDIOutput::send(Uint8Array* data, ExceptionState& es) | 93 void MIDIOutput::send(Uint8Array* data, ExceptionState& es) |
| 94 { | 94 { |
| 95 send(data, 0, es); | 95 send(data, 0, es); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void MIDIOutput::send(Vector<unsigned> unsignedData, ExceptionState& es) | 98 void MIDIOutput::send(Vector<unsigned> unsignedData, ExceptionState& es) |
| 99 { | 99 { |
| 100 send(unsignedData, 0, es); | 100 send(unsignedData, 0, es); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace WebCore | 103 } // namespace WebCore |
| OLD | NEW |