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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/MIDIAccessResolver.h
diff --git a/LICENSE b/Source/bindings/v8/MIDIAccessResolver.h
similarity index 64%
copy from LICENSE
copy to Source/bindings/v8/MIDIAccessResolver.h
index 70bcb8ad118978579fa055f7ecc99604930900ce..e8207d5d54e69f49edc10831a479bc9525cc9955 100644
--- a/LICENSE
+++ b/Source/bindings/v8/MIDIAccessResolver.h
@@ -28,3 +28,40 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef MIDIAccessResolver_h
+#define MIDIAccessResolver_h
+
+#include "bindings/v8/ScriptPromiseResolver.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace WebCore {
+
+class DOMError;
+class DOMWrapperWorld;
+class ExecutionContext;
+class MIDIAccess;
+
+class MIDIAccessResolver {
+ WTF_MAKE_NONCOPYABLE(MIDIAccessResolver);
+public:
+ static PassOwnPtr<MIDIAccessResolver> create(PassRefPtr<ScriptPromiseResolver> resolver, ExecutionContext* executionContext)
+ {
+ return adoptPtr(new MIDIAccessResolver(resolver, executionContext));
+ }
+ ~MIDIAccessResolver();
+
+ void resolve(MIDIAccess*, ExecutionContext*);
+ void reject(DOMError*, ExecutionContext*);
+
+private:
+ MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver>, ExecutionContext*);
+
+ RefPtr<ScriptPromiseResolver> m_resolver;
+ RefPtr<DOMWrapperWorld> m_world;
+};
+
+} // namespace WebCore
+
+#endif // #ifndef MIDIAccessResolver_h

Powered by Google App Engine
This is Rietveld 408576698