Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: Source/modules/webaudio/AudioParamTimeline.cpp

Issue 1214463003: Split "Online" and "Offline" AudioContext processing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring to ToT Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioParamTimeline.h ('k') | Source/modules/webaudio/AudioScheduledSourceNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698