OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef NavigatorWebMIDI_h | 31 #ifndef NavigatorWebMIDI_h |
32 #define NavigatorWebMIDI_h | 32 #define NavigatorWebMIDI_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptPromise.h" | 34 #include "bindings/core/v8/ScriptPromise.h" |
35 #include "core/dom/ContextLifecycleObserver.h" | |
36 #include "core/frame/Navigator.h" | 35 #include "core/frame/Navigator.h" |
37 #include "modules/webmidi/MIDIOptions.h" | 36 #include "modules/webmidi/MIDIOptions.h" |
38 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
39 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
40 | 39 |
41 namespace blink { | 40 namespace blink { |
42 | 41 |
43 class Navigator; | 42 class Navigator; |
44 | 43 |
45 class NavigatorWebMIDI final : public GarbageCollected<NavigatorWebMIDI>, | 44 class NavigatorWebMIDI final : public GarbageCollected<NavigatorWebMIDI>, |
46 public Supplement<Navigator>, | 45 public Supplement<Navigator> { |
47 public ContextClient { | |
48 USING_GARBAGE_COLLECTED_MIXIN(NavigatorWebMIDI); | 46 USING_GARBAGE_COLLECTED_MIXIN(NavigatorWebMIDI); |
49 | 47 |
50 public: | 48 public: |
51 static NavigatorWebMIDI& from(Navigator&); | 49 static NavigatorWebMIDI& from(Navigator&); |
52 static ScriptPromise requestMIDIAccess(ScriptState*, | 50 static ScriptPromise requestMIDIAccess(ScriptState*, |
53 Navigator&, | 51 Navigator&, |
54 const MIDIOptions&); | 52 const MIDIOptions&); |
55 ScriptPromise requestMIDIAccess(ScriptState*, const MIDIOptions&); | 53 ScriptPromise requestMIDIAccess(ScriptState*, const MIDIOptions&); |
56 | 54 |
57 DECLARE_VIRTUAL_TRACE(); | 55 DECLARE_VIRTUAL_TRACE(); |
58 | 56 |
59 private: | 57 private: |
60 explicit NavigatorWebMIDI(LocalFrame*); | 58 explicit NavigatorWebMIDI(Navigator&); |
61 static const char* supplementName(); | 59 static const char* supplementName(); |
62 }; | 60 }; |
63 | 61 |
64 } // namespace blink | 62 } // namespace blink |
65 | 63 |
66 #endif // NavigatorWebMIDI_h | 64 #endif // NavigatorWebMIDI_h |
OLD | NEW |