| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 // Remove all events starting at startTime. | 287 // Remove all events starting at startTime. |
| 288 for (unsigned i = 0; i < m_events.size(); ++i) { | 288 for (unsigned i = 0; i < m_events.size(); ++i) { |
| 289 if (m_events[i].time() >= startTime) { | 289 if (m_events[i].time() >= startTime) { |
| 290 m_events.remove(i, m_events.size() - i); | 290 m_events.remove(i, m_events.size() - i); |
| 291 break; | 291 break; |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 float AudioParamTimeline::valueForContextTime(AbstractAudioContext* context, flo
at defaultValue, bool& hasValue) | 296 float AudioParamTimeline::valueForContextTime(BaseAudioContext* context, float d
efaultValue, bool& hasValue) |
| 297 { | 297 { |
| 298 ASSERT(context); | 298 ASSERT(context); |
| 299 | 299 |
| 300 { | 300 { |
| 301 MutexTryLocker tryLocker(m_eventsLock); | 301 MutexTryLocker tryLocker(m_eventsLock); |
| 302 if (!tryLocker.locked() || !context || !m_events.size() || context->curr
entTime() < m_events[0].time()) { | 302 if (!tryLocker.locked() || !context || !m_events.size() || context->curr
entTime() < m_events[0].time()) { |
| 303 hasValue = false; | 303 hasValue = false; |
| 304 return defaultValue; | 304 return defaultValue; |
| 305 } | 305 } |
| 306 } | 306 } |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 for (; writeIndex < numberOfValues; ++writeIndex) | 806 for (; writeIndex < numberOfValues; ++writeIndex) |
| 807 values[writeIndex] = value; | 807 values[writeIndex] = value; |
| 808 | 808 |
| 809 // This value is used to set the .value attribute of the AudioParam. it sho
uld be the last | 809 // This value is used to set the .value attribute of the AudioParam. it sho
uld be the last |
| 810 // computed value. | 810 // computed value. |
| 811 return values[numberOfValues - 1]; | 811 return values[numberOfValues - 1]; |
| 812 } | 812 } |
| 813 | 813 |
| 814 } // namespace blink | 814 } // namespace blink |
| 815 | 815 |
| OLD | NEW |