Chromium Code Reviews| Index: Source/modules/webmidi/MIDIPort.h |
| diff --git a/Source/modules/webmidi/MIDIPort.h b/Source/modules/webmidi/MIDIPort.h |
| index 48e33b7ec7d064f07b78ac0dcd755125620f4b3d..514f308b201309bcee2c3be321f53cd813073d9a 100644 |
| --- a/Source/modules/webmidi/MIDIPort.h |
| +++ b/Source/modules/webmidi/MIDIPort.h |
| @@ -32,7 +32,6 @@ |
| #define MIDIPort_h |
| #include "bindings/v8/ScriptWrappable.h" |
| -#include "core/dom/ActiveDOMObject.h" |
| #include "core/events/EventTarget.h" |
| #include "wtf/RefCounted.h" |
| #include "wtf/RefPtr.h" |
| @@ -40,7 +39,9 @@ |
| namespace WebCore { |
| -class MIDIPort : public RefCounted<MIDIPort>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData { |
| +class MIDIAccess; |
| + |
| +class MIDIPort : public RefCounted<MIDIPort>, public ScriptWrappable, public EventTargetWithInlineData { |
| REFCOUNTED_EVENT_TARGET(MIDIPort); |
| public: |
| enum MIDIPortTypeCode { |
| @@ -48,7 +49,7 @@ public: |
| MIDIPortTypeOutput |
| }; |
| - virtual ~MIDIPort(); |
| + virtual ~MIDIPort() { } |
| String id() const { return m_id; } |
| String manufacturer() const { return m_manufacturer; } |
| @@ -56,14 +57,16 @@ public: |
| String type() const; |
| String version() const { return m_version; } |
| + MIDIAccess* midiAccess() const { return m_access; } |
| + |
| DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); |
| // EventTarget |
| virtual const AtomicString& interfaceName() const OVERRIDE { return EventTargetNames::MIDIPort; } |
| - virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return ActiveDOMObject::executionContext(); } |
| + virtual ExecutionContext* executionContext() const OVERRIDE FINAL; |
| protected: |
| - MIDIPort(ExecutionContext*, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode, const String& version); |
| + MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode, const String& version); |
| private: |
| String m_id; |
| @@ -71,6 +74,7 @@ private: |
| String m_name; |
| MIDIPortTypeCode m_type; |
| String m_version; |
| + MIDIAccess* m_access; |
|
kouhei (in TOK)
2014/02/10 06:07:32
Is this raw-ptr to avoid refcycles? Please comment
|
| }; |
| typedef Vector<RefPtr<MIDIPort> > MIDIPortVector; |