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 29 matching lines...) Expand all Loading... |
40 #include "modules/webmidi/MIDIOutput.h" | 40 #include "modules/webmidi/MIDIOutput.h" |
41 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
42 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
43 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 class ScriptExecutionContext; | 47 class ScriptExecutionContext; |
48 class MIDIAccessPromise; | 48 class MIDIAccessPromise; |
49 | 49 |
50 class MIDIAccess : public RefCounted<MIDIAccess>, public ScriptWrappable, public
ActiveDOMObject, public EventTarget, public MIDIAccessorClient { | 50 class MIDIAccess : public RefCounted<MIDIAccess>, public ScriptWrappable, public
ActiveDOMObject, public EventTargetWithInlineData, public MIDIAccessorClient { |
51 public: | 51 public: |
52 virtual ~MIDIAccess(); | 52 virtual ~MIDIAccess(); |
53 static PassRefPtr<MIDIAccess> create(ScriptExecutionContext*, MIDIAccessProm
ise*); | 53 static PassRefPtr<MIDIAccess> create(ScriptExecutionContext*, MIDIAccessProm
ise*); |
54 | 54 |
55 MIDIInputVector inputs() const { return m_inputs; } | 55 MIDIInputVector inputs() const { return m_inputs; } |
56 MIDIOutputVector outputs() const { return m_outputs; } | 56 MIDIOutputVector outputs() const { return m_outputs; } |
57 | 57 |
58 using RefCounted<MIDIAccess>::ref; | 58 using RefCounted<MIDIAccess>::ref; |
59 using RefCounted<MIDIAccess>::deref; | 59 using RefCounted<MIDIAccess>::deref; |
60 | 60 |
(...skipping 22 matching lines...) Expand all Loading... |
83 | 83 |
84 private: | 84 private: |
85 MIDIAccess(ScriptExecutionContext*, MIDIAccessPromise*); | 85 MIDIAccess(ScriptExecutionContext*, MIDIAccessPromise*); |
86 | 86 |
87 void startRequest(); | 87 void startRequest(); |
88 virtual void permissionDenied(); | 88 virtual void permissionDenied(); |
89 | 89 |
90 // EventTarget | 90 // EventTarget |
91 virtual void refEventTarget() OVERRIDE { ref(); } | 91 virtual void refEventTarget() OVERRIDE { ref(); } |
92 virtual void derefEventTarget() OVERRIDE { deref(); } | 92 virtual void derefEventTarget() OVERRIDE { deref(); } |
93 virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetD
ata; } | |
94 virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventT
argetData; } | |
95 | 93 |
96 MIDIInputVector m_inputs; | 94 MIDIInputVector m_inputs; |
97 MIDIOutputVector m_outputs; | 95 MIDIOutputVector m_outputs; |
98 EventTargetData m_eventTargetData; | |
99 MIDIAccessPromise* m_promise; | 96 MIDIAccessPromise* m_promise; |
100 | 97 |
101 OwnPtr<MIDIAccessor> m_accessor; | 98 OwnPtr<MIDIAccessor> m_accessor; |
102 bool m_hasAccess; | 99 bool m_hasAccess; |
103 bool m_sysExEnabled; | 100 bool m_sysExEnabled; |
104 bool m_requesting; | 101 bool m_requesting; |
105 }; | 102 }; |
106 | 103 |
107 } // namespace WebCore | 104 } // namespace WebCore |
108 | 105 |
109 #endif // MIDIAccess_h | 106 #endif // MIDIAccess_h |
OLD | NEW |