| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 17 matching lines...) Expand all Loading... |
| 28 #include "modules/webaudio/AudioNodeOutput.h" | 28 #include "modules/webaudio/AudioNodeOutput.h" |
| 29 #include "platform/FloatConversion.h" | 29 #include "platform/FloatConversion.h" |
| 30 #include "platform/audio/AudioUtilities.h" | 30 #include "platform/audio/AudioUtilities.h" |
| 31 #include "wtf/MathExtras.h" | 31 #include "wtf/MathExtras.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 const double AudioParamHandler::DefaultSmoothingConstant = 0.05; | 35 const double AudioParamHandler::DefaultSmoothingConstant = 0.05; |
| 36 const double AudioParamHandler::SnapThreshold = 0.001; | 36 const double AudioParamHandler::SnapThreshold = 0.001; |
| 37 | 37 |
| 38 AbstractAudioContext* AudioParamHandler::context() const | 38 AudioDestinationHandler* AudioParamHandler::context() const |
| 39 { | 39 { |
| 40 // TODO(tkent): We can remove this dangerous function by removing | 40 return &m_destination; |
| 41 // AbstractAudioContext dependency from AudioParamTimeline. | |
| 42 ASSERT_WITH_SECURITY_IMPLICATION(deferredTaskHandler().isAudioThread()); | |
| 43 return m_context; | |
| 44 } | 41 } |
| 45 | 42 |
| 46 float AudioParamHandler::value() | 43 float AudioParamHandler::value() |
| 47 { | 44 { |
| 48 // Update value for timeline. | 45 // Update value for timeline. |
| 49 float v = intrinsicValue(); | 46 float v = intrinsicValue(); |
| 50 if (deferredTaskHandler().isAudioThread()) { | 47 if (deferredTaskHandler().isAudioThread()) { |
| 51 bool hasValue; | 48 bool hasValue; |
| 52 float timelineValue = m_timeline.valueForContextTime(context(), v, hasVa
lue); | 49 float timelineValue = m_timeline.valueForContextTime(context(), v, hasVa
lue); |
| 53 | 50 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 258 } |
| 262 | 259 |
| 263 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState&
exceptionState) | 260 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState&
exceptionState) |
| 264 { | 261 { |
| 265 handler().timeline().cancelScheduledValues(startTime, exceptionState); | 262 handler().timeline().cancelScheduledValues(startTime, exceptionState); |
| 266 return this; | 263 return this; |
| 267 } | 264 } |
| 268 | 265 |
| 269 } // namespace blink | 266 } // namespace blink |
| 270 | 267 |
| OLD | NEW |