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

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

Issue 1214463003: Split "Online" and "Offline" AudioContext processing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring to ToT Created 5 years, 5 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 12 matching lines...) Expand all
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 #if ENABLE(WEB_AUDIO) 26 #if ENABLE(WEB_AUDIO)
27 #include "modules/webaudio/AudioScheduledSourceNode.h" 27 #include "modules/webaudio/AudioScheduledSourceNode.h"
28 28
29 #include "bindings/core/v8/ExceptionState.h" 29 #include "bindings/core/v8/ExceptionState.h"
30 #include "core/dom/CrossThreadTask.h" 30 #include "core/dom/CrossThreadTask.h"
31 #include "core/dom/ExceptionCode.h" 31 #include "core/dom/ExceptionCode.h"
32 #include "modules/EventModules.h" 32 #include "modules/EventModules.h"
33 #include "modules/webaudio/AudioContext.h" 33 #include "modules/webaudio/AbstractAudioContext.h"
34 #include "platform/audio/AudioUtilities.h" 34 #include "platform/audio/AudioUtilities.h"
35 #include "wtf/MathExtras.h" 35 #include "wtf/MathExtras.h"
36 #include <algorithm> 36 #include <algorithm>
37 37
38 namespace blink { 38 namespace blink {
39 39
40 const double AudioScheduledSourceHandler::UnknownTime = -1; 40 const double AudioScheduledSourceHandler::UnknownTime = -1;
41 41
42 AudioScheduledSourceHandler::AudioScheduledSourceHandler(NodeType nodeType, Audi oNode& node, float sampleRate) 42 AudioScheduledSourceHandler::AudioScheduledSourceHandler(NodeType nodeType, Audi oNode& node, float sampleRate)
43 : AudioHandler(nodeType, node, sampleRate) 43 : AudioHandler(nodeType, node, sampleRate)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 void AudioScheduledSourceHandler::notifyEnded() 211 void AudioScheduledSourceHandler::notifyEnded()
212 { 212 {
213 ASSERT(isMainThread()); 213 ASSERT(isMainThread());
214 if (node()) 214 if (node())
215 node()->dispatchEvent(Event::create(EventTypeNames::ended)); 215 node()->dispatchEvent(Event::create(EventTypeNames::ended));
216 } 216 }
217 217
218 // ---------------------------------------------------------------- 218 // ----------------------------------------------------------------
219 219
220 AudioScheduledSourceNode::AudioScheduledSourceNode(AudioContext& context) 220 AudioScheduledSourceNode::AudioScheduledSourceNode(AbstractAudioContext& context )
221 : AudioSourceNode(context) 221 : AudioSourceNode(context)
222 { 222 {
223 } 223 }
224 224
225 AudioScheduledSourceHandler& AudioScheduledSourceNode::audioScheduledSourceHandl er() const 225 AudioScheduledSourceHandler& AudioScheduledSourceNode::audioScheduledSourceHandl er() const
226 { 226 {
227 return static_cast<AudioScheduledSourceHandler&>(handler()); 227 return static_cast<AudioScheduledSourceHandler&>(handler());
228 } 228 }
229 229
230 void AudioScheduledSourceNode::start(ExceptionState& exceptionState) 230 void AudioScheduledSourceNode::start(ExceptionState& exceptionState)
(...skipping 23 matching lines...) Expand all
254 254
255 void AudioScheduledSourceNode::setOnended(PassRefPtr<EventListener> listener) 255 void AudioScheduledSourceNode::setOnended(PassRefPtr<EventListener> listener)
256 { 256 {
257 audioScheduledSourceHandler().setHasEndedListener(); 257 audioScheduledSourceHandler().setHasEndedListener();
258 setAttributeEventListener(EventTypeNames::ended, listener); 258 setAttributeEventListener(EventTypeNames::ended, listener);
259 } 259 }
260 260
261 } // namespace blink 261 } // namespace blink
262 262
263 #endif // ENABLE(WEB_AUDIO) 263 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioScheduledSourceNode.h ('k') | Source/modules/webaudio/AudioSourceNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698