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

Side by Side Diff: Source/modules/webmidi/MIDIAccess.cpp

Issue 15995010: Web MIDI: implement MIDIAccessPromise (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webmidi/MIDIAccess.h ('k') | Source/modules/webmidi/MIDIAccessPromise.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 #include "modules/webmidi/MIDIAccess.h" 32 #include "modules/webmidi/MIDIAccess.h"
33 33
34 #include "core/dom/ExceptionCode.h" 34 #include "core/dom/ExceptionCode.h"
35 #include "modules/webmidi/MIDIConnectionEvent.h" 35 #include "modules/webmidi/MIDIConnectionEvent.h"
36 #include "modules/webmidi/MIDIInput.h" 36 #include "modules/webmidi/MIDIInput.h"
37 #include "modules/webmidi/MIDIOutput.h" 37 #include "modules/webmidi/MIDIOutput.h"
38 #include "modules/webmidi/MIDIPort.h" 38 #include "modules/webmidi/MIDIPort.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 PassRefPtr<MIDIAccess> MIDIAccess::create(ScriptExecutionContext* context) 42 PassRefPtr<MIDIAccess> MIDIAccess::create(ScriptExecutionContext* context, MIDIA ccessPromise* promise)
43 { 43 {
44 RefPtr<MIDIAccess> midiAccess(adoptRef(new MIDIAccess(context))); 44 RefPtr<MIDIAccess> midiAccess(adoptRef(new MIDIAccess(context, promise)));
45 midiAccess->suspendIfNeeded(); 45 midiAccess->suspendIfNeeded();
46 return midiAccess.release(); 46 return midiAccess.release();
47 } 47 }
48 48
49 MIDIAccess::~MIDIAccess() 49 MIDIAccess::~MIDIAccess()
50 { 50 {
51 stop(); 51 stop();
52 } 52 }
53 53
54 MIDIAccess::MIDIAccess(ScriptExecutionContext* context) 54 MIDIAccess::MIDIAccess(ScriptExecutionContext* context, MIDIAccessPromise* promi se)
55 : ActiveDOMObject(context) 55 : ActiveDOMObject(context)
56 , m_promise(promise)
56 { 57 {
57 ScriptWrappable::init(this); 58 ScriptWrappable::init(this);
58 } 59 }
59 60
60 } // namespace WebCore 61 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccess.h ('k') | Source/modules/webmidi/MIDIAccessPromise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698