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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 visitor->trace(m_session); 296 visitor->trace(m_session);
297 ContentDecryptionModuleResultPromise::trace(visitor); 297 ContentDecryptionModuleResultPromise::trace(visitor);
298 } 298 }
299 299
300 private: 300 private:
301 Member<MediaKeySession> m_session; 301 Member<MediaKeySession> m_session;
302 }; 302 };
303 303
304 MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* me diaKeys, WebEncryptedMediaSessionType sessionType) 304 MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* me diaKeys, WebEncryptedMediaSessionType sessionType)
305 { 305 {
306 RefPtrWillBeRawPtr<MediaKeySession> session = new MediaKeySession(scriptStat e, mediaKeys, sessionType); 306 RawPtr<MediaKeySession> session = new MediaKeySession(scriptState, mediaKeys , sessionType);
307 session->suspendIfNeeded(); 307 session->suspendIfNeeded();
308 return session.get(); 308 return session.get();
309 } 309 }
310 310
311 MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, WebEncryptedMediaSessionType sessionType) 311 MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, WebEncryptedMediaSessionType sessionType)
312 : ActiveDOMObject(scriptState->executionContext()) 312 : ActiveDOMObject(scriptState->executionContext())
313 , m_asyncEventQueue(GenericEventQueue::create(this)) 313 , m_asyncEventQueue(GenericEventQueue::create(this))
314 , m_mediaKeys(mediaKeys) 314 , m_mediaKeys(mediaKeys)
315 , m_sessionType(sessionType) 315 , m_sessionType(sessionType)
316 , m_expiration(std::numeric_limits<double>::quiet_NaN()) 316 , m_expiration(std::numeric_limits<double>::quiet_NaN())
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 break; 794 break;
795 case WebContentDecryptionModuleSession::Client::MessageType::LicenseRenewal: 795 case WebContentDecryptionModuleSession::Client::MessageType::LicenseRenewal:
796 init.setMessageType("license-renewal"); 796 init.setMessageType("license-renewal");
797 break; 797 break;
798 case WebContentDecryptionModuleSession::Client::MessageType::LicenseRelease: 798 case WebContentDecryptionModuleSession::Client::MessageType::LicenseRelease:
799 init.setMessageType("license-release"); 799 init.setMessageType("license-release");
800 break; 800 break;
801 } 801 }
802 init.setMessage(DOMArrayBuffer::create(static_cast<const void*>(message), me ssageLength)); 802 init.setMessage(DOMArrayBuffer::create(static_cast<const void*>(message), me ssageLength));
803 803
804 RefPtrWillBeRawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::creat e(EventTypeNames::message, init); 804 RawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeN ames::message, init);
805 event->setTarget(this); 805 event->setTarget(this);
806 m_asyncEventQueue->enqueueEvent(event.release()); 806 m_asyncEventQueue->enqueueEvent(event.release());
807 } 807 }
808 808
809 void MediaKeySession::close() 809 void MediaKeySession::close()
810 { 810 {
811 WTF_LOG(Media, "MediaKeySession(%p)::close", this); 811 WTF_LOG(Media, "MediaKeySession(%p)::close", this);
812 812
813 // From https://w3c.github.io/encrypted-media/#session-close: 813 // From https://w3c.github.io/encrypted-media/#session-close:
814 // The following steps are run: 814 // The following steps are run:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 for (size_t i = 0; i < keys.size(); ++i) { 862 for (size_t i = 0; i < keys.size(); ++i) {
863 // 4.2.1 Let pair be the pair. 863 // 4.2.1 Let pair be the pair.
864 const auto& key = keys[i]; 864 const auto& key = keys[i];
865 // 4.2.2 Insert an entry for pair's key ID into statuses with the 865 // 4.2.2 Insert an entry for pair's key ID into statuses with the
866 // value of pair's MediaKeyStatus value. 866 // value of pair's MediaKeyStatus value.
867 m_keyStatusesMap->addEntry(key.id(), ConvertKeyStatusToString(key.status ())); 867 m_keyStatusesMap->addEntry(key.id(), ConvertKeyStatusToString(key.status ()));
868 } 868 }
869 869
870 // 5. Queue a task to fire a simple event named keystatuseschange 870 // 5. Queue a task to fire a simple event named keystatuseschange
871 // at the session. 871 // at the session.
872 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::keystatusesc hange); 872 RawPtr<Event> event = Event::create(EventTypeNames::keystatuseschange);
873 event->setTarget(this); 873 event->setTarget(this);
874 m_asyncEventQueue->enqueueEvent(event.release()); 874 m_asyncEventQueue->enqueueEvent(event.release());
875 875
876 // 6. Queue a task to run the attempt to resume playback if necessary 876 // 6. Queue a task to run the attempt to resume playback if necessary
877 // algorithm on each of the media element(s) whose mediaKeys attribute 877 // algorithm on each of the media element(s) whose mediaKeys attribute
878 // is the MediaKeys object that created the session. The user agent 878 // is the MediaKeys object that created the session. The user agent
879 // may choose to skip this step if it knows resuming will fail. 879 // may choose to skip this step if it knows resuming will fail.
880 // FIXME: Attempt to resume playback if |hasAdditionalUsableKey| is true. 880 // FIXME: Attempt to resume playback if |hasAdditionalUsableKey| is true.
881 // http://crbug.com/413413 881 // http://crbug.com/413413
882 } 882 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698