Chromium Code Reviews| Index: Source/modules/webmidi/MIDIInput.h |
| diff --git a/Source/modules/webmidi/MIDIErrorCallback.h b/Source/modules/webmidi/MIDIInput.h |
| similarity index 71% |
| copy from Source/modules/webmidi/MIDIErrorCallback.h |
| copy to Source/modules/webmidi/MIDIInput.h |
| index 3a0e41edbee99b7c447866ce544afa475c131c10..b5ba6d3d716f0caf68cc94ee5ca399caf375c9ba 100644 |
| --- a/Source/modules/webmidi/MIDIErrorCallback.h |
| +++ b/Source/modules/webmidi/MIDIInput.h |
| @@ -28,26 +28,31 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef MIDIErrorCallback_h |
| -#define MIDIErrorCallback_h |
| +#ifndef MIDIInput_h |
| +#define MIDIInput_h |
| -#include "wtf/PassRefPtr.h" |
| -#include "wtf/RefCounted.h" |
| +#include "core/dom/EventTarget.h" |
| +#include "modules/webmidi/MIDIPort.h" |
| namespace WebCore { |
| -class DOMError; |
| class ScriptExecutionContext; |
| -class MIDIErrorCallback : public RefCounted<MIDIErrorCallback> { |
| +class MIDIInput : public MIDIPort { |
| public: |
| - virtual ~MIDIErrorCallback() { } |
| - virtual bool handleEvent(DOMError*) = 0; |
| - // Helper to post callback task. |
| - void scheduleCallback(ScriptExecutionContext*, PassRefPtr<DOMError>); |
| + virtual ~MIDIInput() { } |
|
Chris Rogers
2013/05/02 19:26:57
small nit: I'd put the destructor after create()
|
| + static PassRefPtr<MIDIInput> create(ScriptExecutionContext*, const String& id, const String& manufacturer, const String& name, const String& version); |
| + |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(midimessage); |
| + |
| + // EventTarget |
| + virtual const AtomicString& interfaceName() const OVERRIDE { return eventNames().interfaceForMIDIInput; } |
| + |
| +private: |
| + MIDIInput(ScriptExecutionContext*, const String& id, const String& manufacturer, const String& name, const String& version); |
| }; |
| } // namespace WebCore |
| -#endif // MIDIErrorCallback_h |
| +#endif // MIDIInput_h |