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

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

Issue 14520002: Web MIDI: implement MIDIInput (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/modules/webmidi/MIDIInput.h
diff --git a/Source/modules/webmidi/MIDIErrorCallback.h b/Source/modules/webmidi/MIDIInput.h
similarity index 69%
copy from Source/modules/webmidi/MIDIErrorCallback.h
copy to Source/modules/webmidi/MIDIInput.h
index 3a0e41edbee99b7c447866ce544afa475c131c10..512ec9c1d8f0d06d653668f2f840c4fc781da9d8 100644
--- a/Source/modules/webmidi/MIDIErrorCallback.h
+++ b/Source/modules/webmidi/MIDIInput.h
@@ -28,26 +28,32 @@
* 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() { }
+ static PassRefPtr<MIDIInput> create(ScriptExecutionContext*, const String& id, const String& manufacturer, const String& name, const String& version);
+ static PassRefPtr<MIDIInput> create(PassRefPtr<MIDIPort>);
Chris Rogers 2013/04/26 19:55:39 I'm not sure I understand how this create() method
Takashi Toyoshima 2013/05/02 08:55:25 In my first implementation, this was called from M
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
Chris Rogers 2013/04/26 19:55:39 Chris Wilson has told me that the name should be "
Takashi Toyoshima 2013/05/02 08:55:25 Yes. I discussed it here. https://github.com/WebAu
+
+ // 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

Powered by Google App Engine
This is Rietveld 408576698