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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 ExecutionContext* MIDIPort::getExecutionContext() const { | 146 ExecutionContext* MIDIPort::getExecutionContext() const { |
147 return m_access->getExecutionContext(); | 147 return m_access->getExecutionContext(); |
148 } | 148 } |
149 | 149 |
150 bool MIDIPort::hasPendingActivity() const { | 150 bool MIDIPort::hasPendingActivity() const { |
151 // MIDIPort should survive if ConnectionState is "open" or can be "open" via | 151 // MIDIPort should survive if ConnectionState is "open" or can be "open" via |
152 // a MIDIConnectionEvent even if there are no references from JavaScript. | 152 // a MIDIConnectionEvent even if there are no references from JavaScript. |
153 return m_connection != ConnectionStateClosed; | 153 return m_connection != ConnectionStateClosed; |
154 } | 154 } |
155 | 155 |
156 void MIDIPort::stop() { | 156 void MIDIPort::contextDestroyed() { |
157 // Should be "closed" to assume there are no pending activities. | 157 // Should be "closed" to assume there are no pending activities. |
158 m_connection = ConnectionStateClosed; | 158 m_connection = ConnectionStateClosed; |
159 } | 159 } |
160 | 160 |
161 DEFINE_TRACE(MIDIPort) { | 161 DEFINE_TRACE(MIDIPort) { |
162 visitor->trace(m_access); | 162 visitor->trace(m_access); |
163 EventTargetWithInlineData::trace(visitor); | 163 EventTargetWithInlineData::trace(visitor); |
164 ActiveDOMObject::trace(visitor); | 164 ActiveDOMObject::trace(visitor); |
165 } | 165 } |
166 | 166 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 connection != ConnectionStateOpen); | 199 connection != ConnectionStateOpen); |
200 if (m_state == state && m_connection == connection) | 200 if (m_state == state && m_connection == connection) |
201 return; | 201 return; |
202 m_state = state; | 202 m_state = state; |
203 m_connection = connection; | 203 m_connection = connection; |
204 dispatchEvent(MIDIConnectionEvent::create(this)); | 204 dispatchEvent(MIDIConnectionEvent::create(this)); |
205 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); | 205 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); |
206 } | 206 } |
207 | 207 |
208 } // namespace blink | 208 } // namespace blink |
OLD | NEW |