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

Side by Side Diff: Source/modules/webaudio/AudioNode.cpp

Issue 14028011: Made AudioNode an EventTarget (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made AudioNode an EventTarget Created 7 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 /* 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 else 275 else
276 ec = INVALID_STATE_ERR; 276 ec = INVALID_STATE_ERR;
277 } 277 }
278 278
279 void AudioNode::updateChannelsForInputs() 279 void AudioNode::updateChannelsForInputs()
280 { 280 {
281 for (unsigned i = 0; i < m_inputs.size(); ++i) 281 for (unsigned i = 0; i < m_inputs.size(); ++i)
282 input(i)->changedOutputs(); 282 input(i)->changedOutputs();
283 } 283 }
284 284
285 const AtomicString& AudioNode::interfaceName() const
286 {
287 return eventNames().interfaceForAudioNode;
288 }
289
290 ScriptExecutionContext* AudioNode::scriptExecutionContext() const
291 {
292 return const_cast<AudioNode*>(this)->context()->scriptExecutionContext();
293 }
294
285 void AudioNode::processIfNecessary(size_t framesToProcess) 295 void AudioNode::processIfNecessary(size_t framesToProcess)
286 { 296 {
287 ASSERT(context()->isAudioThread()); 297 ASSERT(context()->isAudioThread());
288 298
289 if (!isInitialized()) 299 if (!isInitialized())
290 return; 300 return;
291 301
292 // Ensure that we only process once per rendering quantum. 302 // Ensure that we only process once per rendering quantum.
293 // This handles the "fanout" problem where an output is connected to multipl e inputs. 303 // This handles the "fanout" problem where an output is connected to multipl e inputs.
294 // The first time we're called during this time slice we process, but after that we don't want to re-process, 304 // The first time we're called during this time slice we process, but after that we don't want to re-process,
295 // instead our output(s) will already have the results cached in their bus; 305 // instead our output(s) will already have the results cached in their bus;
296 double currentTime = context()->currentTime(); 306 double currentTime = context()->currentTime();
297 if (m_lastProcessingTime != currentTime) { 307 if (m_lastProcessingTime != currentTime) {
298 m_lastProcessingTime = currentTime; // important to first update this ti me because of feedback loops in the rendering graph 308 m_lastProcessingTime = currentTime; // important to first update this ti me because of feedback loops in the rendering graph
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]); 526 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]);
517 527
518 fprintf(stderr, "===========================\n\n\n"); 528 fprintf(stderr, "===========================\n\n\n");
519 } 529 }
520 530
521 #endif // DEBUG_AUDIONODE_REFERENCES 531 #endif // DEBUG_AUDIONODE_REFERENCES
522 532
523 } // namespace WebCore 533 } // namespace WebCore
524 534
525 #endif // ENABLE(WEB_AUDIO) 535 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698