| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 // Remove all events starting at startTime. | 173 // Remove all events starting at startTime. |
| 174 for (unsigned i = 0; i < m_events.size(); ++i) { | 174 for (unsigned i = 0; i < m_events.size(); ++i) { |
| 175 if (m_events[i].time() >= startTime) { | 175 if (m_events[i].time() >= startTime) { |
| 176 m_events.remove(i, m_events.size() - i); | 176 m_events.remove(i, m_events.size() - i); |
| 177 break; | 177 break; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 float AudioParamTimeline::valueForContextTime(AudioContext* context, float defau
ltValue, bool& hasValue) | 182 float AudioParamTimeline::valueForContextTime(AbstractAudioContext* context, flo
at defaultValue, bool& hasValue) |
| 183 { | 183 { |
| 184 ASSERT(context); | 184 ASSERT(context); |
| 185 | 185 |
| 186 { | 186 { |
| 187 MutexTryLocker tryLocker(m_eventsLock); | 187 MutexTryLocker tryLocker(m_eventsLock); |
| 188 if (!tryLocker.locked() || !context || !m_events.size() || context->curr
entTime() < m_events[0].time()) { | 188 if (!tryLocker.locked() || !context || !m_events.size() || context->curr
entTime() < m_events[0].time()) { |
| 189 hasValue = false; | 189 hasValue = false; |
| 190 return defaultValue; | 190 return defaultValue; |
| 191 } | 191 } |
| 192 } | 192 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // to the end of the values buffer. | 428 // to the end of the values buffer. |
| 429 for (; writeIndex < numberOfValues; ++writeIndex) | 429 for (; writeIndex < numberOfValues; ++writeIndex) |
| 430 values[writeIndex] = value; | 430 values[writeIndex] = value; |
| 431 | 431 |
| 432 return value; | 432 return value; |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace blink | 435 } // namespace blink |
| 436 | 436 |
| 437 #endif // ENABLE(WEB_AUDIO) | 437 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |