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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 764 |
765 // 3. If session's callable value is false, return a promise rejected with | 765 // 3. If session's callable value is false, return a promise rejected with |
766 // an InvalidStateError. | 766 // an InvalidStateError. |
767 if (!m_isCallable) | 767 if (!m_isCallable) |
768 return CreateRejectedPromiseNotCallable(scriptState); | 768 return CreateRejectedPromiseNotCallable(scriptState); |
769 | 769 |
770 // 4. Let promise be a new promise. | 770 // 4. Let promise be a new promise. |
771 SimpleResultPromise* result = new SimpleResultPromise(scriptState, this); | 771 SimpleResultPromise* result = new SimpleResultPromise(scriptState, this); |
772 ScriptPromise promise = result->promise(); | 772 ScriptPromise promise = result->promise(); |
773 | 773 |
774 // 4. Run the following steps in parallel (done in closeTask()). | 774 // 5. Run the following steps in parallel (done in closeTask()). |
775 m_pendingActions.append(PendingAction::CreatePendingClose(result)); | 775 m_pendingActions.append(PendingAction::CreatePendingClose(result)); |
776 if (!m_actionTimer.isActive()) | 776 if (!m_actionTimer.isActive()) |
777 m_actionTimer.startOneShot(0, BLINK_FROM_HERE); | 777 m_actionTimer.startOneShot(0, BLINK_FROM_HERE); |
778 | 778 |
779 // 5. Return promise. | 779 // 6. Return promise. |
780 return promise; | 780 return promise; |
781 } | 781 } |
782 | 782 |
783 void MediaKeySession::closeTask(ContentDecryptionModuleResult* result) { | 783 void MediaKeySession::closeTask(ContentDecryptionModuleResult* result) { |
784 // NOTE: Continue step 4 of MediaKeySession::close(). | 784 // NOTE: Continue step 4 of MediaKeySession::close(). |
785 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; | 785 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; |
786 | 786 |
787 // close() in Chromium will execute steps 5.1 through 5.3. | 787 // close() in Chromium will execute steps 5.1 through 5.3. |
788 m_session->close(result->result()); | 788 m_session->close(result->result()); |
789 | 789 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 visitor->trace(m_asyncEventQueue); | 1045 visitor->trace(m_asyncEventQueue); |
1046 visitor->trace(m_pendingActions); | 1046 visitor->trace(m_pendingActions); |
1047 visitor->trace(m_mediaKeys); | 1047 visitor->trace(m_mediaKeys); |
1048 visitor->trace(m_keyStatusesMap); | 1048 visitor->trace(m_keyStatusesMap); |
1049 visitor->trace(m_closedPromise); | 1049 visitor->trace(m_closedPromise); |
1050 EventTargetWithInlineData::trace(visitor); | 1050 EventTargetWithInlineData::trace(visitor); |
1051 ActiveDOMObject::trace(visitor); | 1051 ActiveDOMObject::trace(visitor); |
1052 } | 1052 } |
1053 | 1053 |
1054 } // namespace blink | 1054 } // namespace blink |
OLD | NEW |