Chromium Code Reviews| 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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1026 << (m_asyncEventQueue->hasPendingEvents() | 1026 << (m_asyncEventQueue->hasPendingEvents() |
| 1027 ? " m_asyncEventQueue->hasPendingEvents()" | 1027 ? " m_asyncEventQueue->hasPendingEvents()" |
| 1028 : "") | 1028 : "") |
| 1029 << ((m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); | 1029 << ((m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); |
| 1030 | 1030 |
| 1031 return !m_pendingActions.isEmpty() || m_asyncEventQueue->hasPendingEvents() || | 1031 return !m_pendingActions.isEmpty() || m_asyncEventQueue->hasPendingEvents() || |
| 1032 (m_mediaKeys && !m_isClosed); | 1032 (m_mediaKeys && !m_isClosed); |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 void MediaKeySession::contextDestroyed() { | 1035 void MediaKeySession::contextDestroyed() { |
| 1036 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; | |
| 1037 | |
| 1038 // If call contextDestroyed before close session, | |
| 1039 // clear session without closeTask. | |
| 1040 // So call closeTask if there is a delayed pendingAction::Close. | |
|
haraken
2016/11/01 07:21:38
// When the context is destroyed, we need to close
| |
| 1041 while (!m_pendingActions.isEmpty()) { | |
| 1042 PendingAction* action = m_pendingActions.takeFirst(); | |
| 1043 if (action->getType() == PendingAction::Close) { | |
| 1044 closeTask(action->result()); | |
| 1045 break; | |
|
haraken
2016/11/01 06:56:15
Sorry, would you explain why we need 'break' here?
Dongheun Kang
2016/11/01 07:09:29
I think can't add duplicated close action in pendi
| |
| 1046 } | |
| 1047 } | |
| 1048 | |
| 1036 // Stop the CDM from firing any more events for this session. | 1049 // Stop the CDM from firing any more events for this session. |
| 1037 m_session.reset(); | 1050 m_session.reset(); |
| 1038 m_isClosed = true; | 1051 m_isClosed = true; |
| 1039 m_actionTimer.stop(); | 1052 m_actionTimer.stop(); |
| 1040 m_pendingActions.clear(); | 1053 m_pendingActions.clear(); |
| 1041 m_asyncEventQueue->close(); | 1054 m_asyncEventQueue->close(); |
| 1042 } | 1055 } |
| 1043 | 1056 |
| 1044 DEFINE_TRACE(MediaKeySession) { | 1057 DEFINE_TRACE(MediaKeySession) { |
| 1045 visitor->trace(m_asyncEventQueue); | 1058 visitor->trace(m_asyncEventQueue); |
| 1046 visitor->trace(m_pendingActions); | 1059 visitor->trace(m_pendingActions); |
| 1047 visitor->trace(m_mediaKeys); | 1060 visitor->trace(m_mediaKeys); |
| 1048 visitor->trace(m_keyStatusesMap); | 1061 visitor->trace(m_keyStatusesMap); |
| 1049 visitor->trace(m_closedPromise); | 1062 visitor->trace(m_closedPromise); |
| 1050 EventTargetWithInlineData::trace(visitor); | 1063 EventTargetWithInlineData::trace(visitor); |
| 1051 ActiveDOMObject::trace(visitor); | 1064 ActiveDOMObject::trace(visitor); |
| 1052 } | 1065 } |
| 1053 | 1066 |
| 1054 } // namespace blink | 1067 } // namespace blink |
| OLD | NEW |