| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 class ExceptionState; | 63 class ExceptionState; |
| 64 class GainNode; | 64 class GainNode; |
| 65 class HTMLMediaElement; | 65 class HTMLMediaElement; |
| 66 class MediaElementAudioSourceNode; | 66 class MediaElementAudioSourceNode; |
| 67 class MediaStreamAudioDestinationNode; | 67 class MediaStreamAudioDestinationNode; |
| 68 class MediaStreamAudioSourceNode; | 68 class MediaStreamAudioSourceNode; |
| 69 class OscillatorNode; | 69 class OscillatorNode; |
| 70 class PannerNode; | 70 class PannerNode; |
| 71 class PeriodicWave; | 71 class PeriodicWave; |
| 72 class ScriptProcessorNode; | 72 class ScriptProcessorNode; |
| 73 class SecurityOrigin; |
| 73 class StereoPannerNode; | 74 class StereoPannerNode; |
| 74 class WaveShaperNode; | 75 class WaveShaperNode; |
| 75 | 76 |
| 76 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. | 77 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. |
| 77 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. | 78 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. |
| 78 | 79 |
| 79 class AudioContext : public RefCountedGarbageCollectedEventTargetWithInlineData<
AudioContext>, public ActiveDOMObject { | 80 class AudioContext : public RefCountedGarbageCollectedEventTargetWithInlineData<
AudioContext>, public ActiveDOMObject { |
| 80 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); | 81 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); |
| 81 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); | 82 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); |
| 82 DEFINE_WRAPPERTYPEINFO(); | 83 DEFINE_WRAPPERTYPEINFO(); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void notifyStateChange(); | 261 void notifyStateChange(); |
| 261 | 262 |
| 262 // The context itself keeps a reference to all source nodes. The source nod
es, then reference all nodes they're connected to. | 263 // The context itself keeps a reference to all source nodes. The source nod
es, then reference all nodes they're connected to. |
| 263 // In turn, these nodes reference all nodes they're connected to. All nodes
are ultimately connected to the AudioDestinationNode. | 264 // In turn, these nodes reference all nodes they're connected to. All nodes
are ultimately connected to the AudioDestinationNode. |
| 264 // When the context dereferences a source node, it will be deactivated from
the rendering graph along with all other nodes it is | 265 // When the context dereferences a source node, it will be deactivated from
the rendering graph along with all other nodes it is |
| 265 // uniquely connected to. See the AudioNode::ref() and AudioNode::deref() m
ethods for more details. | 266 // uniquely connected to. See the AudioNode::ref() and AudioNode::deref() m
ethods for more details. |
| 266 void refNode(AudioNode*); | 267 void refNode(AudioNode*); |
| 267 | 268 |
| 268 static unsigned s_hardwareContextCount; | 269 static unsigned s_hardwareContextCount; |
| 269 | 270 |
| 271 // Get the security origin for this audio context. |
| 272 SecurityOrigin* securityOrigin() const; |
| 273 |
| 270 protected: | 274 protected: |
| 271 explicit AudioContext(Document*); | 275 explicit AudioContext(Document*); |
| 272 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); | 276 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); |
| 273 | 277 |
| 274 RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver; | 278 RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver; |
| 275 private: | 279 private: |
| 276 void initialize(); | 280 void initialize(); |
| 277 void uninitialize(); | 281 void uninitialize(); |
| 278 | 282 |
| 279 // ExecutionContext calls stop twice. | 283 // ExecutionContext calls stop twice. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 void handleStoppableSourceNodes(); | 417 void handleStoppableSourceNodes(); |
| 414 | 418 |
| 415 // This is considering 32 is large enough for multiple channels audio. | 419 // This is considering 32 is large enough for multiple channels audio. |
| 416 // It is somewhat arbitrary and could be increased if necessary. | 420 // It is somewhat arbitrary and could be increased if necessary. |
| 417 enum { MaxNumberOfChannels = 32 }; | 421 enum { MaxNumberOfChannels = 32 }; |
| 418 }; | 422 }; |
| 419 | 423 |
| 420 } // namespace blink | 424 } // namespace blink |
| 421 | 425 |
| 422 #endif // AudioContext_h | 426 #endif // AudioContext_h |
| OLD | NEW |