| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // index. | 207 // index. |
| 208 context()->getExecutionContext()->postTask( | 208 context()->getExecutionContext()->postTask( |
| 209 BLINK_FROM_HERE, | 209 BLINK_FROM_HERE, |
| 210 createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent, | 210 createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent, |
| 211 crossThreadUnretained(this), | 211 crossThreadUnretained(this), |
| 212 m_doubleBufferIndex)); | 212 m_doubleBufferIndex)); |
| 213 } else { | 213 } else { |
| 214 // If this node is in the offline audio context, use the | 214 // If this node is in the offline audio context, use the |
| 215 // waitable event to synchronize to the offline rendering thread. | 215 // waitable event to synchronize to the offline rendering thread. |
| 216 std::unique_ptr<WaitableEvent> waitableEvent = | 216 std::unique_ptr<WaitableEvent> waitableEvent = |
| 217 makeUnique<WaitableEvent>(); | 217 WTF::makeUnique<WaitableEvent>(); |
| 218 | 218 |
| 219 context()->getExecutionContext()->postTask( | 219 context()->getExecutionContext()->postTask( |
| 220 BLINK_FROM_HERE, | 220 BLINK_FROM_HERE, |
| 221 createCrossThreadTask( | 221 createCrossThreadTask( |
| 222 &ScriptProcessorHandler::fireProcessEventForOfflineAudioContext, | 222 &ScriptProcessorHandler::fireProcessEventForOfflineAudioContext, |
| 223 crossThreadUnretained(this), m_doubleBufferIndex, | 223 crossThreadUnretained(this), m_doubleBufferIndex, |
| 224 crossThreadUnretained(waitableEvent.get()))); | 224 crossThreadUnretained(waitableEvent.get()))); |
| 225 | 225 |
| 226 // Okay to block the offline audio rendering thread since it is | 226 // Okay to block the offline audio rendering thread since it is |
| 227 // not the actual audio device thread. | 227 // not the actual audio device thread. |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 // If |onaudioprocess| event handler is defined, the node should not be | 474 // If |onaudioprocess| event handler is defined, the node should not be |
| 475 // GCed even if it is out of scope. | 475 // GCed even if it is out of scope. |
| 476 if (hasEventListeners(EventTypeNames::audioprocess)) | 476 if (hasEventListeners(EventTypeNames::audioprocess)) |
| 477 return true; | 477 return true; |
| 478 | 478 |
| 479 return false; | 479 return false; |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace blink | 482 } // namespace blink |
| OLD | NEW |