| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 37 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
| 38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
| 39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class MIDIAccess; | 43 class MIDIAccess; |
| 44 | 44 |
| 45 class MIDIPort : public RefCountedWillBeRefCountedGarbageCollected<MIDIPort>, pu
blic ScriptWrappable, public EventTargetWithInlineData { | 45 class MIDIPort : public RefCountedWillBeRefCountedGarbageCollected<MIDIPort>, pu
blic ScriptWrappable, public EventTargetWithInlineData { |
| 46 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<M
IDIPort>); | 46 REFCOUNTED_EVENT_TARGET(MIDIPort); |
| 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); |
| 47 public: | 48 public: |
| 48 enum MIDIPortTypeCode { | 49 enum MIDIPortTypeCode { |
| 49 MIDIPortTypeInput, | 50 MIDIPortTypeInput, |
| 50 MIDIPortTypeOutput | 51 MIDIPortTypeOutput |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 virtual ~MIDIPort() { } | 54 virtual ~MIDIPort() { } |
| 54 | 55 |
| 55 String id() const { return m_id; } | 56 String id() const { return m_id; } |
| 56 String manufacturer() const { return m_manufacturer; } | 57 String manufacturer() const { return m_manufacturer; } |
| 57 String name() const { return m_name; } | 58 String name() const { return m_name; } |
| 58 String type() const; | 59 String type() const; |
| 59 String version() const { return m_version; } | 60 String version() const { return m_version; } |
| 60 | 61 |
| 61 MIDIAccess* midiAccess() const { return m_access; } | 62 MIDIAccess* midiAccess() const { return m_access; } |
| 62 | 63 |
| 63 virtual void trace(Visitor*); | 64 virtual void trace(Visitor*) OVERRIDE; |
| 64 | 65 |
| 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); | 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); |
| 66 | 67 |
| 67 // EventTarget | 68 // EventTarget |
| 68 virtual const AtomicString& interfaceName() const OVERRIDE { return EventTar
getNames::MIDIPort; } | 69 virtual const AtomicString& interfaceName() const OVERRIDE { return EventTar
getNames::MIDIPort; } |
| 69 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; | 70 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; |
| 70 | 71 |
| 71 protected: | 72 protected: |
| 72 MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const St
ring& name, MIDIPortTypeCode, const String& version); | 73 MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const St
ring& name, MIDIPortTypeCode, const String& version); |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 String m_id; | 76 String m_id; |
| 76 String m_manufacturer; | 77 String m_manufacturer; |
| 77 String m_name; | 78 String m_name; |
| 78 MIDIPortTypeCode m_type; | 79 MIDIPortTypeCode m_type; |
| 79 String m_version; | 80 String m_version; |
| 80 RawPtrWillBeMember<MIDIAccess> m_access; | 81 RawPtrWillBeMember<MIDIAccess> m_access; |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace WebCore | 84 } // namespace WebCore |
| 84 | 85 |
| 85 #endif // MIDIPort_h | 86 #endif // MIDIPort_h |
| OLD | NEW |