| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 // If the context is going away, m_scheduledSuspends could have had all its | 412 // If the context is going away, m_scheduledSuspends could have had all its |
| 413 // entries removed. Check for that here. | 413 // entries removed. Check for that here. |
| 414 if (m_scheduledSuspends.size()) { | 414 if (m_scheduledSuspends.size()) { |
| 415 // |frame| must exist in the map. | 415 // |frame| must exist in the map. |
| 416 DCHECK(m_scheduledSuspends.contains(frame)); | 416 DCHECK(m_scheduledSuspends.contains(frame)); |
| 417 | 417 |
| 418 SuspendMap::iterator it = m_scheduledSuspends.find(frame); | 418 SuspendMap::iterator it = m_scheduledSuspends.find(frame); |
| 419 it->value->resolve(); | 419 it->value->resolve(); |
| 420 | 420 |
| 421 m_scheduledSuspends.remove(it); | 421 m_scheduledSuspends.erase(it); |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 void OfflineAudioContext::rejectPendingResolvers() { | 425 void OfflineAudioContext::rejectPendingResolvers() { |
| 426 DCHECK(isMainThread()); | 426 DCHECK(isMainThread()); |
| 427 | 427 |
| 428 // Wait until the suspend map is available for removal. | 428 // Wait until the suspend map is available for removal. |
| 429 AutoLocker locker(this); | 429 AutoLocker locker(this); |
| 430 | 430 |
| 431 // Offline context is going away so reject any promises that are still | 431 // Offline context is going away so reject any promises that are still |
| (...skipping 15 matching lines...) Expand all Loading... |
| 447 | 447 |
| 448 // Note that the GraphLock is required before this check. Since this needs | 448 // Note that the GraphLock is required before this check. Since this needs |
| 449 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 449 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
| 450 if (m_scheduledSuspends.contains(currentSampleFrame())) | 450 if (m_scheduledSuspends.contains(currentSampleFrame())) |
| 451 return true; | 451 return true; |
| 452 | 452 |
| 453 return false; | 453 return false; |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace blink | 456 } // namespace blink |
| OLD | NEW |