OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MIDIAccessResolver_h | 5 #ifndef MIDIAccessResolver_h |
6 #define MIDIAccessResolver_h | 6 #define MIDIAccessResolver_h |
7 | 7 |
8 #include "bindings/v8/ScriptPromiseResolver.h" | 8 #include "bindings/v8/ScriptPromiseResolver.h" |
9 #include "wtf/OwnPtr.h" | 9 #include "wtf/OwnPtr.h" |
10 #include "wtf/RefCounted.h" | 10 #include "wtf/RefCounted.h" |
11 | 11 |
12 namespace WebCore { | 12 namespace WebCore { |
13 | 13 |
14 class DOMError; | 14 class DOMError; |
15 class DOMWrapperWorld; | |
16 class ExecutionContext; | 15 class ExecutionContext; |
17 class MIDIAccess; | 16 class MIDIAccess; |
18 | 17 |
19 class MIDIAccessResolver { | 18 class MIDIAccessResolver { |
20 WTF_MAKE_NONCOPYABLE(MIDIAccessResolver); | 19 WTF_MAKE_NONCOPYABLE(MIDIAccessResolver); |
21 public: | 20 public: |
22 static PassOwnPtr<MIDIAccessResolver> create(PassRefPtr<ScriptPromiseResolve
r> resolver, v8::Isolate* isolate) | 21 static PassOwnPtr<MIDIAccessResolver> create(PassRefPtr<ScriptPromiseResolve
r> resolver, v8::Isolate* isolate) |
23 { | 22 { |
24 return adoptPtr(new MIDIAccessResolver(resolver, isolate)); | 23 return adoptPtr(new MIDIAccessResolver(resolver, isolate)); |
25 } | 24 } |
26 ~MIDIAccessResolver(); | 25 ~MIDIAccessResolver(); |
27 | 26 |
28 ScriptPromise promise() { return m_resolver->promise(); } | 27 ScriptPromise promise() { return m_resolver->promise(); } |
29 | 28 |
30 void resolve(MIDIAccess*, ExecutionContext*); | 29 void resolve(MIDIAccess*, ExecutionContext*); |
31 void reject(DOMError*, ExecutionContext*); | 30 void reject(DOMError*, ExecutionContext*); |
32 | 31 |
33 private: | 32 private: |
34 MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver>, v8::Isolate*); | 33 MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver>, v8::Isolate*); |
35 | 34 |
36 RefPtr<ScriptPromiseResolver> m_resolver; | 35 RefPtr<ScriptPromiseResolver> m_resolver; |
37 RefPtr<DOMWrapperWorld> m_world; | 36 RefPtr<NewScriptState> m_scriptState; |
38 }; | 37 }; |
39 | 38 |
40 } // namespace WebCore | 39 } // namespace WebCore |
41 | 40 |
42 #endif // #ifndef MIDIAccessResolver_h | 41 #endif // #ifndef MIDIAccessResolver_h |
OLD | NEW |