| 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 ExecutionContext* MediaKeySession::executionContext() const | 889 ExecutionContext* MediaKeySession::executionContext() const |
| 890 { | 890 { |
| 891 return ActiveDOMObject::executionContext(); | 891 return ActiveDOMObject::executionContext(); |
| 892 } | 892 } |
| 893 | 893 |
| 894 bool MediaKeySession::hasPendingActivity() const | 894 bool MediaKeySession::hasPendingActivity() const |
| 895 { | 895 { |
| 896 // Remain around if there are pending events or MediaKeys is still around | 896 // Remain around if there are pending events or MediaKeys is still around |
| 897 // and we're not closed. | 897 // and we're not closed. |
| 898 WTF_LOG(Media, "MediaKeySession(%p)::hasPendingActivity %s%s%s%s", this, | 898 WTF_LOG(Media, "MediaKeySession(%p)::hasPendingActivity %s%s%s%s", this, |
| 899 ActiveDOMObject::hasPendingActivity() ? " ActiveDOMObject::hasPendingAct
ivity()" : "", | 899 ScriptWrappable::hasPendingActivity() ? " ScriptWrappable::hasPendingAct
ivity()" : "", |
| 900 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "", | 900 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "", |
| 901 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE
vents()" : "", | 901 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE
vents()" : "", |
| 902 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); | 902 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); |
| 903 | 903 |
| 904 return ActiveDOMObject::hasPendingActivity() | 904 return ScriptWrappable::hasPendingActivity() |
| 905 || !m_pendingActions.isEmpty() | 905 || !m_pendingActions.isEmpty() |
| 906 || m_asyncEventQueue->hasPendingEvents() | 906 || m_asyncEventQueue->hasPendingEvents() |
| 907 || (m_mediaKeys && !m_isClosed); | 907 || (m_mediaKeys && !m_isClosed); |
| 908 } | 908 } |
| 909 | 909 |
| 910 void MediaKeySession::stop() | 910 void MediaKeySession::stop() |
| 911 { | 911 { |
| 912 // Stop the CDM from firing any more events for this session. | 912 // Stop the CDM from firing any more events for this session. |
| 913 m_session.clear(); | 913 m_session.clear(); |
| 914 m_isClosed = true; | 914 m_isClosed = true; |
| 915 | 915 |
| 916 if (m_actionTimer.isActive()) | 916 if (m_actionTimer.isActive()) |
| 917 m_actionTimer.stop(); | 917 m_actionTimer.stop(); |
| 918 m_pendingActions.clear(); | 918 m_pendingActions.clear(); |
| 919 m_asyncEventQueue->close(); | 919 m_asyncEventQueue->close(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 DEFINE_TRACE(MediaKeySession) | 922 DEFINE_TRACE(MediaKeySession) |
| 923 { | 923 { |
| 924 visitor->trace(m_asyncEventQueue); | 924 visitor->trace(m_asyncEventQueue); |
| 925 visitor->trace(m_pendingActions); | 925 visitor->trace(m_pendingActions); |
| 926 visitor->trace(m_mediaKeys); | 926 visitor->trace(m_mediaKeys); |
| 927 visitor->trace(m_keyStatusesMap); | 927 visitor->trace(m_keyStatusesMap); |
| 928 visitor->trace(m_closedPromise); | 928 visitor->trace(m_closedPromise); |
| 929 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); | 929 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); |
| 930 ActiveDOMObject::trace(visitor); | 930 ActiveDOMObject::trace(visitor); |
| 931 } | 931 } |
| 932 | 932 |
| 933 } // namespace blink | 933 } // namespace blink |
| OLD | NEW |