Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp

Issue 1133713008: [WIP] Migrate hasPendingActivity from ActiveDOMObject to ScriptWrappable. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 ExecutionContext* MediaKeySession::executionContext() const 890 ExecutionContext* MediaKeySession::executionContext() const
891 { 891 {
892 return ActiveDOMObject::executionContext(); 892 return ActiveDOMObject::executionContext();
893 } 893 }
894 894
895 bool MediaKeySession::hasPendingActivity() const 895 bool MediaKeySession::hasPendingActivity() const
896 { 896 {
897 // Remain around if there are pending events or MediaKeys is still around 897 // Remain around if there are pending events or MediaKeys is still around
898 // and we're not closed. 898 // and we're not closed.
899 WTF_LOG(Media, "MediaKeySession(%p)::hasPendingActivity %s%s%s%s", this, 899 WTF_LOG(Media, "MediaKeySession(%p)::hasPendingActivity %s%s%s%s", this,
900 ActiveDOMObject::hasPendingActivity() ? " ActiveDOMObject::hasPendingAct ivity()" : "", 900 ScriptWrappable::hasPendingActivity() ? " ScriptWrappable::hasPendingAct ivity()" : "",
901 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "", 901 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "",
902 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE vents()" : "", 902 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE vents()" : "",
903 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); 903 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : "");
904 904
905 return ActiveDOMObject::hasPendingActivity() 905 return ScriptWrappable::hasPendingActivity()
906 || !m_pendingActions.isEmpty() 906 || !m_pendingActions.isEmpty()
907 || m_asyncEventQueue->hasPendingEvents() 907 || m_asyncEventQueue->hasPendingEvents()
908 || (m_mediaKeys && !m_isClosed); 908 || (m_mediaKeys && !m_isClosed);
909 } 909 }
910 910
911 void MediaKeySession::stop() 911 void MediaKeySession::stop()
912 { 912 {
913 // Stop the CDM from firing any more events for this session. 913 // Stop the CDM from firing any more events for this session.
914 m_session.clear(); 914 m_session.clear();
915 m_isClosed = true; 915 m_isClosed = true;
916 916
917 if (m_actionTimer.isActive()) 917 if (m_actionTimer.isActive())
918 m_actionTimer.stop(); 918 m_actionTimer.stop();
919 m_pendingActions.clear(); 919 m_pendingActions.clear();
920 m_asyncEventQueue->close(); 920 m_asyncEventQueue->close();
921 } 921 }
922 922
923 DEFINE_TRACE(MediaKeySession) 923 DEFINE_TRACE(MediaKeySession)
924 { 924 {
925 visitor->trace(m_asyncEventQueue); 925 visitor->trace(m_asyncEventQueue);
926 visitor->trace(m_pendingActions); 926 visitor->trace(m_pendingActions);
927 visitor->trace(m_mediaKeys); 927 visitor->trace(m_mediaKeys);
928 visitor->trace(m_keyStatusesMap); 928 visitor->trace(m_keyStatusesMap);
929 visitor->trace(m_closedPromise); 929 visitor->trace(m_closedPromise);
930 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor); 930 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor);
931 ActiveDOMObject::trace(visitor); 931 ActiveDOMObject::trace(visitor);
932 } 932 }
933 933
934 } // namespace blink 934 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698