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

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: Review Comments 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
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", this,
900 ActiveDOMObject::hasPendingActivity() ? " ActiveDOMObject::hasPendingAct ivity()" : "",
901 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "", 900 !m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "",
902 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE vents()" : "", 901 m_asyncEventQueue->hasPendingEvents() ? " m_asyncEventQueue->hasPendingE vents()" : "",
903 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : ""); 902 (m_mediaKeys && !m_isClosed) ? " m_mediaKeys && !m_isClosed" : "");
904 903
905 return ActiveDOMObject::hasPendingActivity() 904 return !m_pendingActions.isEmpty()
906 || !m_pendingActions.isEmpty()
907 || m_asyncEventQueue->hasPendingEvents() 905 || m_asyncEventQueue->hasPendingEvents()
908 || (m_mediaKeys && !m_isClosed); 906 || (m_mediaKeys && !m_isClosed);
909 } 907 }
910 908
911 void MediaKeySession::stop() 909 void MediaKeySession::stop()
912 { 910 {
913 // Stop the CDM from firing any more events for this session. 911 // Stop the CDM from firing any more events for this session.
914 m_session.clear(); 912 m_session.clear();
915 m_isClosed = true; 913 m_isClosed = true;
916 914
917 if (m_actionTimer.isActive()) 915 if (m_actionTimer.isActive())
918 m_actionTimer.stop(); 916 m_actionTimer.stop();
919 m_pendingActions.clear(); 917 m_pendingActions.clear();
920 m_asyncEventQueue->close(); 918 m_asyncEventQueue->close();
921 } 919 }
922 920
923 DEFINE_TRACE(MediaKeySession) 921 DEFINE_TRACE(MediaKeySession)
924 { 922 {
925 visitor->trace(m_asyncEventQueue); 923 visitor->trace(m_asyncEventQueue);
926 visitor->trace(m_pendingActions); 924 visitor->trace(m_pendingActions);
927 visitor->trace(m_mediaKeys); 925 visitor->trace(m_mediaKeys);
928 visitor->trace(m_keyStatusesMap); 926 visitor->trace(m_keyStatusesMap);
929 visitor->trace(m_closedPromise); 927 visitor->trace(m_closedPromise);
930 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor); 928 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor);
931 ActiveDOMObject::trace(visitor); 929 ActiveDOMObject::trace(visitor);
932 } 930 }
933 931
934 } // namespace blink 932 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698