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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParam.cpp

Issue 1951903003: Assert destination handler exists in AudioParam (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
index ab6894a96fabaae33bd7554d04093c22a1489831..c36bee42e9a534d50fe987adcd0c6aa22df81e6f 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
@@ -35,6 +35,19 @@ namespace blink {
const double AudioParamHandler::DefaultSmoothingConstant = 0.05;
const double AudioParamHandler::SnapThreshold = 0.001;
+AudioParamHandler::AudioParamHandler(AbstractAudioContext& context, AudioParamType paramType, double defaultValue)
+ : AudioSummingJunction(context.deferredTaskHandler())
+ , m_paramType(paramType)
+ , m_intrinsicValue(defaultValue)
+ , m_defaultValue(defaultValue)
+ , m_smoothedValue(defaultValue)
+{
+ // The destination MUST exist because we need the destination handler for the AudioParam.
+ RELEASE_ASSERT(context.destination());
+
+ m_destinationHandler = &context.destination()->audioDestinationHandler();
+}
+
AudioDestinationHandler& AudioParamHandler::destinationHandler() const
{
return *m_destinationHandler;

Powered by Google App Engine
This is Rietveld 408576698