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

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, 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 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 63%
copy from LICENSE
copy to Source/bindings/v8/MIDIAccessResolver.h
index 70bcb8ad118978579fa055f7ecc99604930900ce..9cc62b2fda0cf5bac69922776d9aa0a641128a4f 100644
--- a/LICENSE
+++ b/Source/bindings/v8/MIDIAccessResolver.h
@@ -28,3 +28,44 @@
// 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.
abarth-chromium 2014/03/20 00:43:46 Please use new-style copyright blocks: http://dev
yhirano 2014/03/20 02:40:51 Done.
+
+#ifndef MIDIAccessResolver_h
+#define MIDIAccessResolver_h
+
+#include "bindings/v8/ScriptPromiseResolver.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace v8 {
+class isolate;
abarth-chromium 2014/03/20 00:43:46 This must not be needed because the class is named
yhirano 2014/03/20 02:40:51 Done.
+} // namespace v8
+
+namespace WebCore {
+
+class DOMError;
+class DOMWrapperWorld;
+class ExecutionContext;
+class MIDIAccess;
+
+class MIDIAccessResolver {
+ WTF_MAKE_NONCOPYABLE(MIDIAccessResolver);
+public:
+ static PassOwnPtr<MIDIAccessResolver> create(PassRefPtr<ScriptPromiseResolver> resolver, v8::Isolate* isolate)
+ {
+ return adoptPtr(new MIDIAccessResolver(resolver, isolate));
+ }
+ ~MIDIAccessResolver();
+
+ void resolve(MIDIAccess*, ExecutionContext*);
+ void reject(DOMError*, ExecutionContext*);
+
+private:
+ MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver>, v8::Isolate*);
+
+ RefPtr<ScriptPromiseResolver> m_resolver;
+ RefPtr<DOMWrapperWorld> m_world;
abarth-chromium 2014/03/20 00:43:46 Is RefPtr<DOMWrapperWorld> allowed anymore? harak
yhirano 2014/03/20 02:40:51 Currently FrameLoader and ErrorEvent use RefPtr<DO
haraken 2014/03/20 04:37:16 RefPtr<DOMWrapperWorld> is ok here. Dan and I disc
+};
+
+} // namespace WebCore
+
+#endif // #ifndef MIDIAccessResolver_h

Powered by Google App Engine
This is Rietveld 408576698