Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: Source/bindings/v8/MIDIAccessResolver.h

Issue 77773003: Make WebMIDI use blink Promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/MIDIAccessResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MIDIAccessResolver_h
6 #define MIDIAccessResolver_h
7
8 #include "bindings/v8/ScriptPromiseResolver.h"
9 #include "wtf/OwnPtr.h"
10 #include "wtf/RefCounted.h"
11
12 namespace WebCore {
13
14 class DOMError;
15 class DOMWrapperWorld;
16 class ExecutionContext;
17 class MIDIAccess;
18
19 class MIDIAccessResolver {
20 WTF_MAKE_NONCOPYABLE(MIDIAccessResolver);
21 public:
22 static PassOwnPtr<MIDIAccessResolver> create(PassRefPtr<ScriptPromiseResolve r> resolver, v8::Isolate* isolate)
23 {
24 return adoptPtr(new MIDIAccessResolver(resolver, isolate));
25 }
26 ~MIDIAccessResolver();
27
28 ScriptPromise promise() { return m_resolver->promise(); }
29
30 void resolve(MIDIAccess*, ExecutionContext*);
31 void reject(DOMError*, ExecutionContext*);
32
33 private:
34 MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver>, v8::Isolate*);
35
36 RefPtr<ScriptPromiseResolver> m_resolver;
37 RefPtr<DOMWrapperWorld> m_world;
38 };
39
40 } // namespace WebCore
41
42 #endif // #ifndef MIDIAccessResolver_h
OLDNEW
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/MIDIAccessResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698