| OLD | NEW |
| 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 Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "modules/webaudio/OfflineAudioContext.h" | 25 #include "modules/webaudio/OfflineAudioContext.h" |
| 26 #include "bindings/core/v8/ExceptionMessages.h" | 26 #include "bindings/core/v8/ExceptionMessages.h" |
| 27 #include "bindings/core/v8/ExceptionState.h" | 27 #include "bindings/core/v8/ExceptionState.h" |
| 28 #include "bindings/core/v8/ScriptState.h" | 28 #include "bindings/core/v8/ScriptState.h" |
| 29 #include "core/dom/DOMException.h" | 29 #include "core/dom/DOMException.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "core/dom/ExceptionCode.h" | 31 #include "core/dom/ExceptionCode.h" |
| 32 #include "core/dom/ExecutionContext.h" | 32 #include "core/dom/ExecutionContext.h" |
| 33 #include "modules/webaudio/AudioListener.h" |
| 33 #include "modules/webaudio/DeferredTaskHandler.h" | 34 #include "modules/webaudio/DeferredTaskHandler.h" |
| 34 #include "modules/webaudio/OfflineAudioCompletionEvent.h" | 35 #include "modules/webaudio/OfflineAudioCompletionEvent.h" |
| 35 #include "modules/webaudio/OfflineAudioDestinationNode.h" | 36 #include "modules/webaudio/OfflineAudioDestinationNode.h" |
| 36 | 37 |
| 37 #include "platform/audio/AudioUtilities.h" | 38 #include "platform/audio/AudioUtilities.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 OfflineAudioContext* OfflineAudioContext::create(ExecutionContext* context, unsi
gned numberOfChannels, unsigned numberOfFrames, float sampleRate, ExceptionState
& exceptionState) | 42 OfflineAudioContext* OfflineAudioContext::create(ExecutionContext* context, unsi
gned numberOfChannels, unsigned numberOfFrames, float sampleRate, ExceptionState
& exceptionState) |
| 42 { | 43 { |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 331 |
| 331 bool OfflineAudioContext::handlePreOfflineRenderTasks() | 332 bool OfflineAudioContext::handlePreOfflineRenderTasks() |
| 332 { | 333 { |
| 333 ASSERT(isAudioThread()); | 334 ASSERT(isAudioThread()); |
| 334 | 335 |
| 335 // OfflineGraphAutoLocker here locks the audio graph for this scope. Note | 336 // OfflineGraphAutoLocker here locks the audio graph for this scope. Note |
| 336 // that this locker does not use tryLock() inside because the timing of | 337 // that this locker does not use tryLock() inside because the timing of |
| 337 // suspension MUST NOT be delayed. | 338 // suspension MUST NOT be delayed. |
| 338 OfflineGraphAutoLocker locker(this); | 339 OfflineGraphAutoLocker locker(this); |
| 339 | 340 |
| 341 // Update the dirty state of the listener. |
| 342 listener()->updateState(); |
| 343 |
| 340 deferredTaskHandler().handleDeferredTasks(); | 344 deferredTaskHandler().handleDeferredTasks(); |
| 341 handleStoppableSourceNodes(); | 345 handleStoppableSourceNodes(); |
| 342 | 346 |
| 343 return shouldSuspend(); | 347 return shouldSuspend(); |
| 344 } | 348 } |
| 345 | 349 |
| 346 void OfflineAudioContext::handlePostOfflineRenderTasks() | 350 void OfflineAudioContext::handlePostOfflineRenderTasks() |
| 347 { | 351 { |
| 348 ASSERT(isAudioThread()); | 352 ASSERT(isAudioThread()); |
| 349 | 353 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 // Note that the GraphLock is required before this check. Since this needs | 394 // Note that the GraphLock is required before this check. Since this needs |
| 391 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 395 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
| 392 if (m_scheduledSuspends.contains(currentSampleFrame())) | 396 if (m_scheduledSuspends.contains(currentSampleFrame())) |
| 393 return true; | 397 return true; |
| 394 | 398 |
| 395 return false; | 399 return false; |
| 396 } | 400 } |
| 397 | 401 |
| 398 } // namespace blink | 402 } // namespace blink |
| 399 | 403 |
| OLD | NEW |