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

Side by Side 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 unified diff | Download patch
OLDNEW
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
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 AudioParamHandler::AudioParamHandler(AbstractAudioContext& context, AudioParamTy pe paramType, double defaultValue)
39 : AudioSummingJunction(context.deferredTaskHandler())
40 , m_paramType(paramType)
41 , m_intrinsicValue(defaultValue)
42 , m_defaultValue(defaultValue)
43 , m_smoothedValue(defaultValue)
44 {
45 // The destination MUST exist because we need the destination handler for th e AudioParam.
46 RELEASE_ASSERT(context.destination());
47
48 m_destinationHandler = &context.destination()->audioDestinationHandler();
49 }
50
38 AudioDestinationHandler& AudioParamHandler::destinationHandler() const 51 AudioDestinationHandler& AudioParamHandler::destinationHandler() const
39 { 52 {
40 return *m_destinationHandler; 53 return *m_destinationHandler;
41 } 54 }
42 55
43 String AudioParamHandler::getParamName() const 56 String AudioParamHandler::getParamName() const
44 { 57 {
45 // The returned string should be the name of the node and the name of the Au dioParam for 58 // The returned string should be the name of the node and the name of the Au dioParam for
46 // that node. 59 // that node.
47 switch (m_paramType) { 60 switch (m_paramType) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 312 }
300 313
301 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState& exceptionState) 314 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState& exceptionState)
302 { 315 {
303 handler().timeline().cancelScheduledValues(startTime, exceptionState); 316 handler().timeline().cancelScheduledValues(startTime, exceptionState);
304 return this; 317 return this;
305 } 318 }
306 319
307 } // namespace blink 320 } // namespace blink
308 321
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698