| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 MediaKeySession* session = | 358 MediaKeySession* session = |
| 359 new MediaKeySession(scriptState, mediaKeys, sessionType); | 359 new MediaKeySession(scriptState, mediaKeys, sessionType); |
| 360 session->suspendIfNeeded(); | 360 session->suspendIfNeeded(); |
| 361 return session; | 361 return session; |
| 362 } | 362 } |
| 363 | 363 |
| 364 MediaKeySession::MediaKeySession(ScriptState* scriptState, | 364 MediaKeySession::MediaKeySession(ScriptState* scriptState, |
| 365 MediaKeys* mediaKeys, | 365 MediaKeys* mediaKeys, |
| 366 WebEncryptedMediaSessionType sessionType) | 366 WebEncryptedMediaSessionType sessionType) |
| 367 : ActiveScriptWrappable(this), | 367 : ActiveScriptWrappable(this), |
| 368 ActiveDOMObject(scriptState->getExecutionContext()), | 368 SuspendableObject(scriptState->getExecutionContext()), |
| 369 m_asyncEventQueue(GenericEventQueue::create(this)), | 369 m_asyncEventQueue(GenericEventQueue::create(this)), |
| 370 m_mediaKeys(mediaKeys), | 370 m_mediaKeys(mediaKeys), |
| 371 m_sessionType(sessionType), | 371 m_sessionType(sessionType), |
| 372 m_expiration(std::numeric_limits<double>::quiet_NaN()), | 372 m_expiration(std::numeric_limits<double>::quiet_NaN()), |
| 373 m_keyStatusesMap(new MediaKeyStatusMap()), | 373 m_keyStatusesMap(new MediaKeyStatusMap()), |
| 374 m_isUninitialized(true), | 374 m_isUninitialized(true), |
| 375 m_isCallable(false), | 375 m_isCallable(false), |
| 376 m_isClosed(false), | 376 m_isClosed(false), |
| 377 m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), | 377 m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), |
| 378 this, | 378 this, |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 // may choose to skip this step if it knows resuming will fail. | 1007 // may choose to skip this step if it knows resuming will fail. |
| 1008 // FIXME: Attempt to resume playback if |hasAdditionalUsableKey| is true. | 1008 // FIXME: Attempt to resume playback if |hasAdditionalUsableKey| is true. |
| 1009 // http://crbug.com/413413 | 1009 // http://crbug.com/413413 |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 const AtomicString& MediaKeySession::interfaceName() const { | 1012 const AtomicString& MediaKeySession::interfaceName() const { |
| 1013 return EventTargetNames::MediaKeySession; | 1013 return EventTargetNames::MediaKeySession; |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 ExecutionContext* MediaKeySession::getExecutionContext() const { | 1016 ExecutionContext* MediaKeySession::getExecutionContext() const { |
| 1017 return ActiveDOMObject::getExecutionContext(); | 1017 return SuspendableObject::getExecutionContext(); |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 bool MediaKeySession::hasPendingActivity() const { | 1020 bool MediaKeySession::hasPendingActivity() const { |
| 1021 // Remain around if there are pending events or MediaKeys is still around | 1021 // Remain around if there are pending events or MediaKeys is still around |
| 1022 // and we're not closed. | 1022 // and we're not closed. |
| 1023 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) | 1023 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) |
| 1024 << __func__ << "(" << this << ")" | 1024 << __func__ << "(" << this << ")" |
| 1025 << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "") | 1025 << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "") |
| 1026 << (m_asyncEventQueue->hasPendingEvents() | 1026 << (m_asyncEventQueue->hasPendingEvents() |
| 1027 ? " m_asyncEventQueue->hasPendingEvents()" | 1027 ? " m_asyncEventQueue->hasPendingEvents()" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1041 m_asyncEventQueue->close(); | 1041 m_asyncEventQueue->close(); |
| 1042 } | 1042 } |
| 1043 | 1043 |
| 1044 DEFINE_TRACE(MediaKeySession) { | 1044 DEFINE_TRACE(MediaKeySession) { |
| 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 SuspendableObject::trace(visitor); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 } // namespace blink | 1054 } // namespace blink |
| OLD | NEW |