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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class ExceptionState; | 60 class ExceptionState; |
61 class GainNode; | 61 class GainNode; |
62 class HTMLMediaElement; | 62 class HTMLMediaElement; |
63 class MediaElementAudioSourceNode; | 63 class MediaElementAudioSourceNode; |
64 class MediaStreamAudioDestinationNode; | 64 class MediaStreamAudioDestinationNode; |
65 class MediaStreamAudioSourceNode; | 65 class MediaStreamAudioSourceNode; |
66 class OscillatorNode; | 66 class OscillatorNode; |
67 class PannerNode; | 67 class PannerNode; |
68 class PeriodicWave; | 68 class PeriodicWave; |
69 class ScriptProcessorNode; | 69 class ScriptProcessorNode; |
| 70 class SecurityOrigin; |
70 class WaveShaperNode; | 71 class WaveShaperNode; |
71 | 72 |
72 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. | 73 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. |
73 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. | 74 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. |
74 | 75 |
75 class AudioContext : public RefCountedGarbageCollectedWillBeGarbageCollectedFina
lized<AudioContext>, public ActiveDOMObject, public EventTargetWithInlineData { | 76 class AudioContext : public RefCountedGarbageCollectedWillBeGarbageCollectedFina
lized<AudioContext>, public ActiveDOMObject, public EventTargetWithInlineData { |
76 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); | 77 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); |
77 DEFINE_WRAPPERTYPEINFO(); | 78 DEFINE_WRAPPERTYPEINFO(); |
78 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); | 79 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); |
79 public: | 80 public: |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; | 229 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; |
229 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; | 230 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; |
230 | 231 |
231 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); | 232 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); |
232 | 233 |
233 void startRendering(); | 234 void startRendering(); |
234 void fireCompletionEvent(); | 235 void fireCompletionEvent(); |
235 | 236 |
236 static unsigned s_hardwareContextCount; | 237 static unsigned s_hardwareContextCount; |
237 | 238 |
| 239 // Get the security origin for this audio context. |
| 240 PassRefPtr<SecurityOrigin> securityOrigin() const; |
| 241 |
238 protected: | 242 protected: |
239 explicit AudioContext(Document*); | 243 explicit AudioContext(Document*); |
240 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); | 244 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); |
241 | 245 |
242 static bool isSampleRateRangeGood(float sampleRate); | 246 static bool isSampleRateRangeGood(float sampleRate); |
243 | 247 |
244 private: | 248 private: |
245 void initialize(); | 249 void initialize(); |
246 void uninitialize(); | 250 void uninitialize(); |
247 | 251 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 HashSet<AudioNode*> m_deferredCountModeChange; | 358 HashSet<AudioNode*> m_deferredCountModeChange; |
355 | 359 |
356 // This is considering 32 is large enough for multiple channels audio. | 360 // This is considering 32 is large enough for multiple channels audio. |
357 // It is somewhat arbitrary and could be increased if necessary. | 361 // It is somewhat arbitrary and could be increased if necessary. |
358 enum { MaxNumberOfChannels = 32 }; | 362 enum { MaxNumberOfChannels = 32 }; |
359 }; | 363 }; |
360 | 364 |
361 } // namespace blink | 365 } // namespace blink |
362 | 366 |
363 #endif // AudioContext_h | 367 #endif // AudioContext_h |
OLD | NEW |