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

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

Issue 2760353002: Define default values for options dictionaries for WebAudio (Closed)
Patch Set: Rebase Created 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webaudio/StereoPannerNode.h" 5 #include "modules/webaudio/StereoPannerNode.h"
6 #include "bindings/core/v8/ExceptionMessages.h" 6 #include "bindings/core/v8/ExceptionMessages.h"
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "modules/webaudio/AudioNodeInput.h" 10 #include "modules/webaudio/AudioNodeInput.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 StereoPannerNode* StereoPannerNode::Create(BaseAudioContext* context, 161 StereoPannerNode* StereoPannerNode::Create(BaseAudioContext* context,
162 const StereoPannerOptions& options, 162 const StereoPannerOptions& options,
163 ExceptionState& exception_state) { 163 ExceptionState& exception_state) {
164 StereoPannerNode* node = Create(*context, exception_state); 164 StereoPannerNode* node = Create(*context, exception_state);
165 165
166 if (!node) 166 if (!node)
167 return nullptr; 167 return nullptr;
168 168
169 node->HandleChannelOptions(options, exception_state); 169 node->HandleChannelOptions(options, exception_state);
170 170
171 if (options.hasPan()) 171 node->pan()->setValue(options.pan());
172 node->pan()->setValue(options.pan());
173 172
174 return node; 173 return node;
175 } 174 }
176 175
177 DEFINE_TRACE(StereoPannerNode) { 176 DEFINE_TRACE(StereoPannerNode) {
178 visitor->Trace(pan_); 177 visitor->Trace(pan_);
179 AudioNode::Trace(visitor); 178 AudioNode::Trace(visitor);
180 } 179 }
181 180
182 AudioParam* StereoPannerNode::pan() const { 181 AudioParam* StereoPannerNode::pan() const {
183 return pan_; 182 return pan_;
184 } 183 }
185 184
186 } // namespace blink 185 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698