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

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

Issue 23596014: Keep AudioScheduledSourceNode alive until onended is called. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Implement ActiveDOMObject::stop() Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 m_frequency = AudioParam::create(context, "frequency", 440, 0, 100000); 67 m_frequency = AudioParam::create(context, "frequency", 440, 0, 100000);
68 // Default to no detuning. 68 // Default to no detuning.
69 m_detune = AudioParam::create(context, "detune", 0, -4800, 4800); 69 m_detune = AudioParam::create(context, "detune", 0, -4800, 4800);
70 70
71 // Sets up default wavetable. 71 // Sets up default wavetable.
72 setType(m_type); 72 setType(m_type);
73 73
74 // An oscillator is always mono. 74 // An oscillator is always mono.
75 addOutput(adoptPtr(new AudioNodeOutput(this, 1))); 75 addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
76 76
77 suspendIfNeeded();
77 initialize(); 78 initialize();
78 } 79 }
79 80
80 OscillatorNode::~OscillatorNode() 81 OscillatorNode::~OscillatorNode()
81 { 82 {
82 uninitialize(); 83 uninitialize();
83 } 84 }
84 85
85 String OscillatorNode::type() const 86 String OscillatorNode::type() const
86 { 87 {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 349 }
349 350
350 bool OscillatorNode::propagatesSilence() const 351 bool OscillatorNode::propagatesSilence() const
351 { 352 {
352 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get(); 353 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get();
353 } 354 }
354 355
355 } // namespace WebCore 356 } // namespace WebCore
356 357
357 #endif // ENABLE(WEB_AUDIO) 358 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698