| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 using midi::mojom::PortState; | 39 using midi::mojom::PortState; |
| 40 | 40 |
| 41 MIDIInput* MIDIInput::create(MIDIAccess* access, | 41 MIDIInput* MIDIInput::create(MIDIAccess* access, |
| 42 const String& id, | 42 const String& id, |
| 43 const String& manufacturer, | 43 const String& manufacturer, |
| 44 const String& name, | 44 const String& name, |
| 45 const String& version, | 45 const String& version, |
| 46 PortState state) { | 46 PortState state) { |
| 47 DCHECK(access); | 47 DCHECK(access); |
| 48 MIDIInput* input = | 48 return new MIDIInput(access, id, manufacturer, name, version, state); |
| 49 new MIDIInput(access, id, manufacturer, name, version, state); | |
| 50 input->suspendIfNeeded(); | |
| 51 return input; | |
| 52 } | 49 } |
| 53 | 50 |
| 54 MIDIInput::MIDIInput(MIDIAccess* access, | 51 MIDIInput::MIDIInput(MIDIAccess* access, |
| 55 const String& id, | 52 const String& id, |
| 56 const String& manufacturer, | 53 const String& manufacturer, |
| 57 const String& name, | 54 const String& name, |
| 58 const String& version, | 55 const String& version, |
| 59 PortState state) | 56 PortState state) |
| 60 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) {} | 57 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) {} |
| 61 | 58 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return; | 98 return; |
| 102 DOMUint8Array* array = DOMUint8Array::create(data, length); | 99 DOMUint8Array* array = DOMUint8Array::create(data, length); |
| 103 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); | 100 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); |
| 104 } | 101 } |
| 105 | 102 |
| 106 DEFINE_TRACE(MIDIInput) { | 103 DEFINE_TRACE(MIDIInput) { |
| 107 MIDIPort::trace(visitor); | 104 MIDIPort::trace(visitor); |
| 108 } | 105 } |
| 109 | 106 |
| 110 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |