| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 // 5. Run the following steps asynchronously (documented in | 618 // 5. Run the following steps asynchronously (documented in |
| 619 // actionTimerFired()). | 619 // actionTimerFired()). |
| 620 m_pendingActions.append(PendingAction::CreatePendingRemove(result)); | 620 m_pendingActions.append(PendingAction::CreatePendingRemove(result)); |
| 621 if (!m_actionTimer.isActive()) | 621 if (!m_actionTimer.isActive()) |
| 622 m_actionTimer.startOneShot(0, BLINK_FROM_HERE); | 622 m_actionTimer.startOneShot(0, BLINK_FROM_HERE); |
| 623 | 623 |
| 624 // 6. Return promise. | 624 // 6. Return promise. |
| 625 return promise; | 625 return promise; |
| 626 } | 626 } |
| 627 | 627 |
| 628 void MediaKeySession::actionTimerFired(Timer<MediaKeySession>*) | 628 void MediaKeySession::actionTimerFired(TimerBase*) |
| 629 { | 629 { |
| 630 DCHECK(m_pendingActions.size()); | 630 DCHECK(m_pendingActions.size()); |
| 631 | 631 |
| 632 // Resolving promises now run synchronously and may result in additional | 632 // Resolving promises now run synchronously and may result in additional |
| 633 // actions getting added to the queue. As a result, swap the queue to | 633 // actions getting added to the queue. As a result, swap the queue to |
| 634 // a local copy to avoid problems if this happens. | 634 // a local copy to avoid problems if this happens. |
| 635 HeapDeque<Member<PendingAction>> pendingActions; | 635 HeapDeque<Member<PendingAction>> pendingActions; |
| 636 pendingActions.swap(m_pendingActions); | 636 pendingActions.swap(m_pendingActions); |
| 637 | 637 |
| 638 while (!pendingActions.isEmpty()) { | 638 while (!pendingActions.isEmpty()) { |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 visitor->trace(m_asyncEventQueue); | 927 visitor->trace(m_asyncEventQueue); |
| 928 visitor->trace(m_pendingActions); | 928 visitor->trace(m_pendingActions); |
| 929 visitor->trace(m_mediaKeys); | 929 visitor->trace(m_mediaKeys); |
| 930 visitor->trace(m_keyStatusesMap); | 930 visitor->trace(m_keyStatusesMap); |
| 931 visitor->trace(m_closedPromise); | 931 visitor->trace(m_closedPromise); |
| 932 EventTargetWithInlineData::trace(visitor); | 932 EventTargetWithInlineData::trace(visitor); |
| 933 ActiveDOMObject::trace(visitor); | 933 ActiveDOMObject::trace(visitor); |
| 934 } | 934 } |
| 935 | 935 |
| 936 } // namespace blink | 936 } // namespace blink |
| OLD | NEW |