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 24 matching lines...) Expand all Loading... |
35 #include "core/loader/DocumentLoader.h" | 35 #include "core/loader/DocumentLoader.h" |
36 #include "modules/webmidi/MIDIAccessInitializer.h" | 36 #include "modules/webmidi/MIDIAccessInitializer.h" |
37 #include "modules/webmidi/MIDIConnectionEvent.h" | 37 #include "modules/webmidi/MIDIConnectionEvent.h" |
38 #include "modules/webmidi/MIDIController.h" | 38 #include "modules/webmidi/MIDIController.h" |
39 #include "modules/webmidi/MIDIInput.h" | 39 #include "modules/webmidi/MIDIInput.h" |
40 #include "modules/webmidi/MIDIInputMap.h" | 40 #include "modules/webmidi/MIDIInputMap.h" |
41 #include "modules/webmidi/MIDIOutput.h" | 41 #include "modules/webmidi/MIDIOutput.h" |
42 #include "modules/webmidi/MIDIOutputMap.h" | 42 #include "modules/webmidi/MIDIOutputMap.h" |
43 #include "modules/webmidi/MIDIPort.h" | 43 #include "modules/webmidi/MIDIPort.h" |
44 #include "platform/AsyncMethodRunner.h" | 44 #include "platform/AsyncMethodRunner.h" |
| 45 #include <memory> |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 using PortState = MIDIAccessor::MIDIPortState; | 49 using PortState = MIDIAccessor::MIDIPortState; |
49 | 50 |
50 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) | 51 MIDIAccess::MIDIAccess(std::unique_ptr<MIDIAccessor> accessor, bool sysexEnabled
, const Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext*
executionContext) |
51 : ActiveScriptWrappable(this) | 52 : ActiveScriptWrappable(this) |
52 , ActiveDOMObject(executionContext) | 53 , ActiveDOMObject(executionContext) |
53 , m_accessor(std::move(accessor)) | 54 , m_accessor(std::move(accessor)) |
54 , m_sysexEnabled(sysexEnabled) | 55 , m_sysexEnabled(sysexEnabled) |
55 , m_hasPendingActivity(false) | 56 , m_hasPendingActivity(false) |
56 { | 57 { |
57 ThreadState::current()->registerPreFinalizer(this); | 58 ThreadState::current()->registerPreFinalizer(this); |
58 m_accessor->setClient(this); | 59 m_accessor->setClient(this); |
59 for (size_t i = 0; i < ports.size(); ++i) { | 60 for (size_t i = 0; i < ports.size(); ++i) { |
60 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; | 61 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 209 |
209 DEFINE_TRACE(MIDIAccess) | 210 DEFINE_TRACE(MIDIAccess) |
210 { | 211 { |
211 visitor->trace(m_inputs); | 212 visitor->trace(m_inputs); |
212 visitor->trace(m_outputs); | 213 visitor->trace(m_outputs); |
213 EventTargetWithInlineData::trace(visitor); | 214 EventTargetWithInlineData::trace(visitor); |
214 ActiveDOMObject::trace(visitor); | 215 ActiveDOMObject::trace(visitor); |
215 } | 216 } |
216 | 217 |
217 } // namespace blink | 218 } // namespace blink |
OLD | NEW |