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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 m_connection = ConnectionStateClosed; | 160 m_connection = ConnectionStateClosed; |
161 } | 161 } |
162 | 162 |
163 DEFINE_TRACE(MIDIPort) | 163 DEFINE_TRACE(MIDIPort) |
164 { | 164 { |
165 visitor->trace(m_access); | 165 visitor->trace(m_access); |
166 EventTargetWithInlineData::trace(visitor); | 166 EventTargetWithInlineData::trace(visitor); |
167 ActiveDOMObject::trace(visitor); | 167 ActiveDOMObject::trace(visitor); |
168 } | 168 } |
169 | 169 |
| 170 DEFINE_TRACE_WRAPPERS(MIDIPort) |
| 171 { |
| 172 visitor->traceWrappers(m_access); |
| 173 } |
| 174 |
170 void MIDIPort::open() | 175 void MIDIPort::open() |
171 { | 176 { |
172 switch (m_state) { | 177 switch (m_state) { |
173 case PortState::MIDIPortStateDisconnected: | 178 case PortState::MIDIPortStateDisconnected: |
174 setStates(m_state, ConnectionStatePending); | 179 setStates(m_state, ConnectionStatePending); |
175 break; | 180 break; |
176 case PortState::MIDIPortStateConnected: | 181 case PortState::MIDIPortStateConnected: |
177 // TODO(toyoshim): Add blink API to perform a real open and close | 182 // TODO(toyoshim): Add blink API to perform a real open and close |
178 // operation. | 183 // operation. |
179 setStates(m_state, ConnectionStateOpen); | 184 setStates(m_state, ConnectionStateOpen); |
(...skipping 16 matching lines...) Expand all Loading... |
196 DCHECK(state != PortState::MIDIPortStateDisconnected || connection != Connec
tionStateOpen); | 201 DCHECK(state != PortState::MIDIPortStateDisconnected || connection != Connec
tionStateOpen); |
197 if (m_state == state && m_connection == connection) | 202 if (m_state == state && m_connection == connection) |
198 return; | 203 return; |
199 m_state = state; | 204 m_state = state; |
200 m_connection = connection; | 205 m_connection = connection; |
201 dispatchEvent(MIDIConnectionEvent::create(this)); | 206 dispatchEvent(MIDIConnectionEvent::create(this)); |
202 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); | 207 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); |
203 } | 208 } |
204 | 209 |
205 } // namespace blink | 210 } // namespace blink |
OLD | NEW |