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

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

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 exceptionState.throwDOMException( 231 exceptionState.throwDOMException(
232 NotSupportedError, 232 NotSupportedError,
233 "channelCountMode cannot be changed from 'explicit' to '" + mode + " '"); 233 "channelCountMode cannot be changed from 'explicit' to '" + mode + " '");
234 } 234 }
235 } 235 }
236 236
237 // ---------------------------------------------------------------- 237 // ----------------------------------------------------------------
238 238
239 ScriptProcessorNode::ScriptProcessorNode(AbstractAudioContext& context, float sa mpleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOu tputChannels) 239 ScriptProcessorNode::ScriptProcessorNode(AbstractAudioContext& context, float sa mpleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOu tputChannels)
240 : AudioNode(context) 240 : AudioNode(context)
241 , ActiveScriptWrappable(this)
241 { 242 {
242 setHandler(ScriptProcessorHandler::create(*this, sampleRate, bufferSize, num berOfInputChannels, numberOfOutputChannels)); 243 setHandler(ScriptProcessorHandler::create(*this, sampleRate, bufferSize, num berOfInputChannels, numberOfOutputChannels));
243 } 244 }
244 245
245 static size_t chooseBufferSize() 246 static size_t chooseBufferSize()
246 { 247 {
247 // Choose a buffer size based on the audio hardware buffer size. Arbitarily make it a power of 248 // Choose a buffer size based on the audio hardware buffer size. Arbitarily make it a power of
248 // two that is 4 times greater than the hardware buffer size. 249 // two that is 4 times greater than the hardware buffer size.
249 // FIXME: What is the best way to choose this? 250 // FIXME: What is the best way to choose this?
250 size_t hardwareBufferSize = Platform::current()->audioHardwareBufferSize(); 251 size_t hardwareBufferSize = Platform::current()->audioHardwareBufferSize();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // If |onaudioprocess| event handler is defined, the node should not be 304 // If |onaudioprocess| event handler is defined, the node should not be
304 // GCed even if it is out of scope. 305 // GCed even if it is out of scope.
305 if (hasEventListeners(EventTypeNames::audioprocess)) 306 if (hasEventListeners(EventTypeNames::audioprocess))
306 return true; 307 return true;
307 308
308 return false; 309 return false;
309 } 310 }
310 311
311 } // namespace blink 312 } // namespace blink
312 313
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698