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

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

Issue 1865583002: Implement BaseAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698