| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 m_completeResolver = ScriptPromiseResolver::create(scriptState); | 192 m_completeResolver = ScriptPromiseResolver::create(scriptState); |
| 193 | 193 |
| 194 // Start rendering and return the promise. | 194 // Start rendering and return the promise. |
| 195 m_isRenderingStarted = true; | 195 m_isRenderingStarted = true; |
| 196 setContextState(Running); | 196 setContextState(Running); |
| 197 destinationHandler().startRendering(); | 197 destinationHandler().startRendering(); |
| 198 | 198 |
| 199 return m_completeResolver->promise(); | 199 return m_completeResolver->promise(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 ScriptPromise OfflineAudioContext::closeContext(ScriptState* scriptState) | |
| 203 { | |
| 204 return ScriptPromise::rejectWithDOMException( | |
| 205 scriptState, | |
| 206 DOMException::create( | |
| 207 InvalidAccessError, | |
| 208 "cannot close an OfflineAudioContext.")); | |
| 209 } | |
| 210 | |
| 211 ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState) | 202 ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState) |
| 212 { | 203 { |
| 213 // This CANNOT be called on OfflineAudioContext; this is only to implement | 204 // This CANNOT be called on OfflineAudioContext; this is only to implement |
| 214 // the pure virtual interface from BaseAudioContext. | 205 // the pure virtual interface from BaseAudioContext. |
| 215 RELEASE_NOTREACHED(); | 206 RELEASE_NOTREACHED(); |
| 216 | 207 |
| 217 return ScriptPromise(); | 208 return ScriptPromise(); |
| 218 } | 209 } |
| 219 | 210 |
| 220 ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState, doub
le when) | 211 ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState, doub
le when) |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 // Note that the GraphLock is required before this check. Since this needs | 432 // Note that the GraphLock is required before this check. Since this needs |
| 442 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 433 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
| 443 if (m_scheduledSuspends.contains(currentSampleFrame())) | 434 if (m_scheduledSuspends.contains(currentSampleFrame())) |
| 444 return true; | 435 return true; |
| 445 | 436 |
| 446 return false; | 437 return false; |
| 447 } | 438 } |
| 448 | 439 |
| 449 } // namespace blink | 440 } // namespace blink |
| 450 | 441 |
| OLD | NEW |