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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "modules/webmidi/MIDIOutput.h" | 31 #include "modules/webmidi/MIDIOutput.h" |
32 | 32 |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
35 #include "core/dom/ExecutionContext.h" | 35 #include "core/dom/ExecutionContext.h" |
36 #include "core/frame/LocalDOMWindow.h" | 36 #include "core/frame/LocalDOMWindow.h" |
37 #include "core/timing/DOMWindowPerformance.h" | 37 #include "core/timing/DOMWindowPerformance.h" |
38 #include "core/timing/Performance.h" | 38 #include "core/timing/Performance.h" |
| 39 #include "media/midi/midi_service.mojom-blink.h" |
39 #include "modules/webmidi/MIDIAccess.h" | 40 #include "modules/webmidi/MIDIAccess.h" |
40 | 41 |
| 42 using midi::mojom::PortState; |
| 43 |
41 namespace blink { | 44 namespace blink { |
42 | 45 |
43 using PortState = MIDIAccessor::MIDIPortState; | |
44 | |
45 namespace { | 46 namespace { |
46 | 47 |
47 double now(ExecutionContext* context) { | 48 double now(ExecutionContext* context) { |
48 LocalDOMWindow* window = context ? context->executingWindow() : nullptr; | 49 LocalDOMWindow* window = context ? context->executingWindow() : nullptr; |
49 Performance* performance = | 50 Performance* performance = |
50 window ? DOMWindowPerformance::performance(*window) : nullptr; | 51 window ? DOMWindowPerformance::performance(*window) : nullptr; |
51 return performance ? performance->now() : 0.0; | 52 return performance ? performance->now() : 0.0; |
52 } | 53 } |
53 | 54 |
54 class MessageValidator { | 55 class MessageValidator { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 void MIDIOutput::send(Vector<unsigned> unsignedData, | 273 void MIDIOutput::send(Vector<unsigned> unsignedData, |
273 ExceptionState& exceptionState) { | 274 ExceptionState& exceptionState) { |
274 send(unsignedData, 0.0, exceptionState); | 275 send(unsignedData, 0.0, exceptionState); |
275 } | 276 } |
276 | 277 |
277 DEFINE_TRACE(MIDIOutput) { | 278 DEFINE_TRACE(MIDIOutput) { |
278 MIDIPort::trace(visitor); | 279 MIDIPort::trace(visitor); |
279 } | 280 } |
280 | 281 |
281 } // namespace blink | 282 } // namespace blink |
OLD | NEW |