Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1820)

Unified Diff: Source/modules/webmidi/MIDIInput.h

Issue 14520002: Web MIDI: implement MIDIInput (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: reviewed Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webmidi/MIDIInput.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..eb283ecc2e7c5a041014b31105a64ce1bbb362cb 100644
--- a/Source/modules/webmidi/MIDIErrorCallback.h
+++ b/Source/modules/webmidi/MIDIInput.h
@@ -28,26 +28,30 @@
* 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;
+ static PassRefPtr<MIDIInput> create(ScriptExecutionContext*, const String& id, const String& manufacturer, const String& name, const String& version);
+ virtual ~MIDIInput() { }
- // Helper to post callback task.
- void scheduleCallback(ScriptExecutionContext*, PassRefPtr<DOMError>);
+ 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webmidi/MIDIInput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698