| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // If there is a duplicate suspension at the same quantized frame, | 276 // If there is a duplicate suspension at the same quantized frame, |
| 277 // reject the promise. | 277 // reject the promise. |
| 278 if (m_scheduledSuspends.contains(frame)) { | 278 if (m_scheduledSuspends.contains(frame)) { |
| 279 resolver->reject(DOMException::create( | 279 resolver->reject(DOMException::create( |
| 280 InvalidStateError, "cannot schedule more than one suspend at frame " + | 280 InvalidStateError, "cannot schedule more than one suspend at frame " + |
| 281 String::number(frame) + " (" + | 281 String::number(frame) + " (" + |
| 282 String::number(when) + " seconds)")); | 282 String::number(when) + " seconds)")); |
| 283 return promise; | 283 return promise; |
| 284 } | 284 } |
| 285 | 285 |
| 286 m_scheduledSuspends.add(frame, resolver); | 286 m_scheduledSuspends.insert(frame, resolver); |
| 287 | 287 |
| 288 return promise; | 288 return promise; |
| 289 } | 289 } |
| 290 | 290 |
| 291 ScriptPromise OfflineAudioContext::resumeContext(ScriptState* scriptState) { | 291 ScriptPromise OfflineAudioContext::resumeContext(ScriptState* scriptState) { |
| 292 DCHECK(isMainThread()); | 292 DCHECK(isMainThread()); |
| 293 | 293 |
| 294 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 294 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| 295 ScriptPromise promise = resolver->promise(); | 295 ScriptPromise promise = resolver->promise(); |
| 296 | 296 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 443 |
| 444 // Note that the GraphLock is required before this check. Since this needs | 444 // Note that the GraphLock is required before this check. Since this needs |
| 445 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 445 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
| 446 if (m_scheduledSuspends.contains(currentSampleFrame())) | 446 if (m_scheduledSuspends.contains(currentSampleFrame())) |
| 447 return true; | 447 return true; |
| 448 | 448 |
| 449 return false; | 449 return false; |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace blink | 452 } // namespace blink |
| OLD | NEW |