| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ASSERT(m_renderThread); | 108 ASSERT(m_renderThread); |
| 109 ASSERT(m_renderTarget); | 109 ASSERT(m_renderTarget); |
| 110 | 110 |
| 111 if (!m_renderTarget) | 111 if (!m_renderTarget) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 // Rendering was not started. Starting now. | 114 // Rendering was not started. Starting now. |
| 115 if (!m_isRenderingStarted) { | 115 if (!m_isRenderingStarted) { |
| 116 m_isRenderingStarted = true; | 116 m_isRenderingStarted = true; |
| 117 m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, | 117 m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, |
| 118 threadSafeBind(&OfflineAudioDestinationHandler::startOfflineRenderin
g, wrapPassRefPtr(this))); | 118 crossThreadBind(&OfflineAudioDestinationHandler::startOfflineRenderi
ng, wrapPassRefPtr(this))); |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Rendering is already started, which implicitly means we resume the | 122 // Rendering is already started, which implicitly means we resume the |
| 123 // rendering by calling |doOfflineRendering| on the render thread. | 123 // rendering by calling |doOfflineRendering| on the render thread. |
| 124 m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, | 124 m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, |
| 125 threadSafeBind(&OfflineAudioDestinationHandler::doOfflineRendering, wrap
PassRefPtr(this))); | 125 crossThreadBind(&OfflineAudioDestinationHandler::doOfflineRendering, wra
pPassRefPtr(this))); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void OfflineAudioDestinationHandler::stopRendering() | 128 void OfflineAudioDestinationHandler::stopRendering() |
| 129 { | 129 { |
| 130 // offline audio rendering CANNOT BE stopped by JavaScript. | 130 // offline audio rendering CANNOT BE stopped by JavaScript. |
| 131 ASSERT_NOT_REACHED(); | 131 ASSERT_NOT_REACHED(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 WebThread* OfflineAudioDestinationHandler::offlineRenderThread() | 134 WebThread* OfflineAudioDestinationHandler::offlineRenderThread() |
| 135 { | 135 { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 { | 319 { |
| 320 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 320 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
| 321 } | 321 } |
| 322 | 322 |
| 323 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) | 323 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) |
| 324 { | 324 { |
| 325 return new OfflineAudioDestinationNode(*context, renderTarget); | 325 return new OfflineAudioDestinationNode(*context, renderTarget); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace blink | 328 } // namespace blink |
| OLD | NEW |