| 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 21 matching lines...) Expand all Loading... |
| 32 #include "modules/webmidi/MIDIAccess.h" | 32 #include "modules/webmidi/MIDIAccess.h" |
| 33 | 33 |
| 34 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
| 35 #include "modules/webmidi/MIDIConnectionEvent.h" | 35 #include "modules/webmidi/MIDIConnectionEvent.h" |
| 36 #include "modules/webmidi/MIDIInput.h" | 36 #include "modules/webmidi/MIDIInput.h" |
| 37 #include "modules/webmidi/MIDIOutput.h" | 37 #include "modules/webmidi/MIDIOutput.h" |
| 38 #include "modules/webmidi/MIDIPort.h" | 38 #include "modules/webmidi/MIDIPort.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 PassRefPtr<MIDIAccess> MIDIAccess::create(ScriptExecutionContext* context) | 42 PassRefPtr<MIDIAccess> MIDIAccess::create(ScriptExecutionContext* context, MIDIA
ccessPromise* promise) |
| 43 { | 43 { |
| 44 RefPtr<MIDIAccess> midiAccess(adoptRef(new MIDIAccess(context))); | 44 RefPtr<MIDIAccess> midiAccess(adoptRef(new MIDIAccess(context, promise))); |
| 45 midiAccess->suspendIfNeeded(); | 45 midiAccess->suspendIfNeeded(); |
| 46 return midiAccess.release(); | 46 return midiAccess.release(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 MIDIAccess::~MIDIAccess() | 49 MIDIAccess::~MIDIAccess() |
| 50 { | 50 { |
| 51 stop(); | 51 stop(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 MIDIAccess::MIDIAccess(ScriptExecutionContext* context) | 54 MIDIAccess::MIDIAccess(ScriptExecutionContext* context, MIDIAccessPromise* promi
se) |
| 55 : ActiveDOMObject(context) | 55 : ActiveDOMObject(context) |
| 56 , m_promise(promise) |
| 56 { | 57 { |
| 57 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
| 58 } | 59 } |
| 59 | 60 |
| 60 } // namespace WebCore | 61 } // namespace WebCore |
| OLD | NEW |