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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Finish up the rendering loop if there is no more to process. | 193 // Finish up the rendering loop if there is no more to process. |
194 if (!m_framesToProcess) | 194 if (!m_framesToProcess) |
195 finishOfflineRendering(); | 195 finishOfflineRendering(); |
196 } | 196 } |
197 | 197 |
198 void OfflineAudioDestinationHandler::suspendOfflineRendering() | 198 void OfflineAudioDestinationHandler::suspendOfflineRendering() |
199 { | 199 { |
200 ASSERT(!isMainThread()); | 200 ASSERT(!isMainThread()); |
201 | 201 |
202 // The actual rendering has been suspended. Notify the context. | 202 // The actual rendering has been suspended. Notify the context. |
203 if (context()->executionContext()) { | 203 if (context()->getExecutionContext()) { |
204 context()->executionContext()->postTask(BLINK_FROM_HERE, | 204 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, |
205 createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend
, this)); | 205 createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend
, this)); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 void OfflineAudioDestinationHandler::finishOfflineRendering() | 209 void OfflineAudioDestinationHandler::finishOfflineRendering() |
210 { | 210 { |
211 ASSERT(!isMainThread()); | 211 ASSERT(!isMainThread()); |
212 | 212 |
213 // The actual rendering has been completed. Notify the context. | 213 // The actual rendering has been completed. Notify the context. |
214 if (context()->executionContext()) { | 214 if (context()->getExecutionContext()) { |
215 context()->executionContext()->postTask(BLINK_FROM_HERE, | 215 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, |
216 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet
e, this)); | 216 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet
e, this)); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 void OfflineAudioDestinationHandler::notifySuspend() | 220 void OfflineAudioDestinationHandler::notifySuspend() |
221 { | 221 { |
222 if (context()) | 222 if (context()) |
223 context()->resolveSuspendOnMainThread(context()->currentSampleFrame()); | 223 context()->resolveSuspendOnMainThread(context()->currentSampleFrame()); |
224 } | 224 } |
225 | 225 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 { | 305 { |
306 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 306 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
307 } | 307 } |
308 | 308 |
309 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) | 309 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo
ntext* context, AudioBuffer* renderTarget) |
310 { | 310 { |
311 return new OfflineAudioDestinationNode(*context, renderTarget); | 311 return new OfflineAudioDestinationNode(*context, renderTarget); |
312 } | 312 } |
313 | 313 |
314 } // namespace blink | 314 } // namespace blink |
OLD | NEW |