| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 { | 763 { |
| 764 // This runs inside the AbstractAudioContext's lock when handling pre-render
tasks. | 764 // This runs inside the AbstractAudioContext's lock when handling pre-render
tasks. |
| 765 ASSERT(isAudioThread()); | 765 ASSERT(isAudioThread()); |
| 766 ASSERT(isGraphOwner()); | 766 ASSERT(isGraphOwner()); |
| 767 | 767 |
| 768 // Resolve any pending promises created by resume(). Only do this if we have
n't already started | 768 // Resolve any pending promises created by resume(). Only do this if we have
n't already started |
| 769 // resolving these promises. This gets called very often and it takes some t
ime to resolve the | 769 // resolving these promises. This gets called very often and it takes some t
ime to resolve the |
| 770 // promises in the main thread. | 770 // promises in the main thread. |
| 771 if (!m_isResolvingResumePromises && m_resumeResolvers.size() > 0) { | 771 if (!m_isResolvingResumePromises && m_resumeResolvers.size() > 0) { |
| 772 m_isResolvingResumePromises = true; | 772 m_isResolvingResumePromises = true; |
| 773 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&A
bstractAudioContext::resolvePromisesForResumeOnMainThread, this)); | 773 Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, thr
eadSafeBind(&AbstractAudioContext::resolvePromisesForResumeOnMainThread, this)); |
| 774 } | 774 } |
| 775 } | 775 } |
| 776 | 776 |
| 777 void AbstractAudioContext::rejectPendingResolvers() | 777 void AbstractAudioContext::rejectPendingResolvers() |
| 778 { | 778 { |
| 779 ASSERT(isMainThread()); | 779 ASSERT(isMainThread()); |
| 780 | 780 |
| 781 // Audio context is closing down so reject any resume promises that are stil
l pending. | 781 // Audio context is closing down so reject any resume promises that are stil
l pending. |
| 782 | 782 |
| 783 for (auto& resolver : m_resumeResolvers) { | 783 for (auto& resolver : m_resumeResolvers) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 { | 856 { |
| 857 if (executionContext()) | 857 if (executionContext()) |
| 858 return executionContext()->securityOrigin(); | 858 return executionContext()->securityOrigin(); |
| 859 | 859 |
| 860 return nullptr; | 860 return nullptr; |
| 861 } | 861 } |
| 862 | 862 |
| 863 } // namespace blink | 863 } // namespace blink |
| 864 | 864 |
| 865 #endif // ENABLE(WEB_AUDIO) | 865 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |