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> | |
46 | 45 |
47 namespace blink { | 46 namespace blink { |
48 | 47 |
49 using PortState = MIDIAccessor::MIDIPortState; | 48 using PortState = MIDIAccessor::MIDIPortState; |
50 | 49 |
51 MIDIAccess::MIDIAccess(std::unique_ptr<MIDIAccessor> accessor, bool sysexEnabled
, const Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext*
executionContext) | 50 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) |
52 : ActiveScriptWrappable(this) | 51 : ActiveScriptWrappable(this) |
53 , ActiveDOMObject(executionContext) | 52 , ActiveDOMObject(executionContext) |
54 , m_accessor(std::move(accessor)) | 53 , m_accessor(std::move(accessor)) |
55 , m_sysexEnabled(sysexEnabled) | 54 , m_sysexEnabled(sysexEnabled) |
56 , m_hasPendingActivity(false) | 55 , m_hasPendingActivity(false) |
57 { | 56 { |
58 ThreadState::current()->registerPreFinalizer(this); | 57 ThreadState::current()->registerPreFinalizer(this); |
59 m_accessor->setClient(this); | 58 m_accessor->setClient(this); |
60 for (size_t i = 0; i < ports.size(); ++i) { | 59 for (size_t i = 0; i < ports.size(); ++i) { |
61 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; | 60 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 208 |
210 DEFINE_TRACE(MIDIAccess) | 209 DEFINE_TRACE(MIDIAccess) |
211 { | 210 { |
212 visitor->trace(m_inputs); | 211 visitor->trace(m_inputs); |
213 visitor->trace(m_outputs); | 212 visitor->trace(m_outputs); |
214 EventTargetWithInlineData::trace(visitor); | 213 EventTargetWithInlineData::trace(visitor); |
215 ActiveDOMObject::trace(visitor); | 214 ActiveDOMObject::trace(visitor); |
216 } | 215 } |
217 | 216 |
218 } // namespace blink | 217 } // namespace blink |
OLD | NEW |