Chromium Code Reviews| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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()->getExecutionContext()) { | 203 if (context()->getExecutionContext()) { |
| 204 context()->getExecutionContext()->postTask( | 204 context()->getExecutionContext()->postTask( |
| 205 BLINK_FROM_HERE, | 205 BLINK_FROM_HERE, |
| 206 createCrossThreadTask( | 206 createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend , PassRefPtr<OfflineAudioDestinationHandler>(this), context()->currentSampleFram e())); |
|
hiroshige
2016/05/17 03:46:12
ditto.
| |
| 207 &OfflineAudioDestinationHandler::notifySuspend, | |
| 208 this, | |
| 209 context()->currentSampleFrame())); | |
| 210 } | 207 } |
| 211 } | 208 } |
| 212 | 209 |
| 213 void OfflineAudioDestinationHandler::finishOfflineRendering() | 210 void OfflineAudioDestinationHandler::finishOfflineRendering() |
| 214 { | 211 { |
| 215 ASSERT(!isMainThread()); | 212 ASSERT(!isMainThread()); |
| 216 | 213 |
| 217 // The actual rendering has been completed. Notify the context. | 214 // The actual rendering has been completed. Notify the context. |
| 218 if (context()->getExecutionContext()) { | 215 if (context()->getExecutionContext()) { |
| 219 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, | 216 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, |
| 220 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet e, AllowCrossThreadAccess(this))); | 217 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet e, PassRefPtr<OfflineAudioDestinationHandler>(this))); |
| 221 } | 218 } |
| 222 } | 219 } |
| 223 | 220 |
| 224 void OfflineAudioDestinationHandler::notifySuspend(size_t frame) | 221 void OfflineAudioDestinationHandler::notifySuspend(size_t frame) |
| 225 { | 222 { |
| 226 ASSERT(isMainThread()); | 223 ASSERT(isMainThread()); |
| 227 | 224 |
| 228 if (context()) | 225 if (context()) |
| 229 context()->resolveSuspendOnMainThread(frame); | 226 context()->resolveSuspendOnMainThread(frame); |
| 230 } | 227 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 { | 308 { |
| 312 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 309 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
| 313 } | 310 } |
| 314 | 311 |
| 315 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo ntext* context, AudioBuffer* renderTarget) | 312 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo ntext* context, AudioBuffer* renderTarget) |
| 316 { | 313 { |
| 317 return new OfflineAudioDestinationNode(*context, renderTarget); | 314 return new OfflineAudioDestinationNode(*context, renderTarget); |
| 318 } | 315 } |
| 319 | 316 |
| 320 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |