| Index: Source/modules/webmidi/MIDIPort.cpp
|
| diff --git a/Source/core/css/CSSFontFaceLoadEvent.cpp b/Source/modules/webmidi/MIDIPort.cpp
|
| similarity index 61%
|
| copy from Source/core/css/CSSFontFaceLoadEvent.cpp
|
| copy to Source/modules/webmidi/MIDIPort.cpp
|
| index 014488a181c823a3b125195e26d09aff666bc95b..9ffa57a6ee304e71d033344806f49e0efdc45a57 100644
|
| --- a/Source/core/css/CSSFontFaceLoadEvent.cpp
|
| +++ b/Source/modules/webmidi/MIDIPort.cpp
|
| @@ -29,38 +29,45 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "CSSFontFaceLoadEvent.h"
|
|
|
| -namespace WebCore {
|
| +#include "modules/webmidi/MIDIPort.h"
|
|
|
| -CSSFontFaceLoadEvent::CSSFontFaceLoadEvent()
|
| -{
|
| - ScriptWrappable::init(this);
|
| -}
|
| +namespace WebCore {
|
|
|
| -CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, PassRefPtr<CSSFontFaceRule> fontface, PassRefPtr<DOMError> error)
|
| - : Event(type, false, false)
|
| - , m_fontface(fontface)
|
| - , m_error(error)
|
| +PassRefPtr<MIDIPort> MIDIPort::create(ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode type, const String& version)
|
| {
|
| - ScriptWrappable::init(this);
|
| + RefPtr<MIDIPort> midiPort(adoptRef(new MIDIPort(context, id, manufacturer, name, type, version)));
|
| + midiPort->suspendIfNeeded();
|
| + return midiPort.release();
|
| }
|
|
|
| -CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, const CSSFontFaceLoadEventInit& initializer)
|
| - : Event(type, initializer)
|
| - , m_fontface(initializer.fontface)
|
| - , m_error(initializer.error)
|
| +MIDIPort::MIDIPort(ScriptExecutionContext* context, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode type, const String& version)
|
| + : ActiveDOMObject(context)
|
| + , m_id(id)
|
| + , m_manufacturer(manufacturer)
|
| + , m_name(name)
|
| + , m_type(type)
|
| + , m_version(version)
|
| {
|
| - ScriptWrappable::init(this);
|
| + ASSERT(type == MIDIPortTypeInput || type == MIDIPortTypeOutput);
|
| }
|
|
|
| -CSSFontFaceLoadEvent::~CSSFontFaceLoadEvent()
|
| +MIDIPort::~MIDIPort()
|
| {
|
| + stop();
|
| }
|
|
|
| -const AtomicString& CSSFontFaceLoadEvent::interfaceName() const
|
| +String MIDIPort::type() const
|
| {
|
| - return eventNames().interfaceForCSSFontFaceLoadEvent;
|
| + switch (m_type) {
|
| + case MIDIPortTypeInput:
|
| + return "input";
|
| + case MIDIPortTypeOutput:
|
| + return "output";
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + }
|
| + return "";
|
| }
|
|
|
| } // namespace WebCore
|
|
|