Changeset 227409 in webkit
- Timestamp:
- Jan 23, 2018 4:07:42 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r227396 r227409 1 2018-01-23 Yacine Bandou <yacine.bandou_ext@softathome.com> 2 3 [EME] Add support of multi keys from different sessions in CDMinstanceClearKey 4 https://bugs.webkit.org/show_bug.cgi?id=180083 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Add support of multi keys from different MediaKeySession in CDMInstanceClearKey. 9 10 Currently the CDMInstanceClearKey manages two "m_keys", one is a WTF::Vector 11 where it stores the list of last added keys, an other which is defined in the 12 ClearKeyState::singleton it is a WTF::HashMap, in this last one, it stores the 13 keys lists of each created session. 14 15 The method "keys()" of CDMInstanceClearKey returns the first "m_keys" which 16 contains just the list of last keys. 17 18 The goal of this commit is to return all keys lists of all sessions, thus 19 we remove the "m_keys" which is WTF::Vector and we modify the method 20 "keys()" to return all keys lists, which is stored in "m_keys" WTF::HashMap, 21 in one Vector instead of return just the list of last keys. 22 23 * platform/encryptedmedia/clearkey/CDMClearKey.cpp: 24 (WebCore::CDMInstanceClearKey::keys const): 25 (WebCore::CDMInstanceClearKey::updateLicense): 26 * platform/encryptedmedia/clearkey/CDMClearKey.h: 27 1 28 2018-01-22 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp
r226965 r227409 481 481 } 482 482 483 const Vector<CDMInstanceClearKey::Key> CDMInstanceClearKey::keys() const 484 { 485 // Return the keys of all sessions. 486 Vector<CDMInstanceClearKey::Key> allKeys { }; 487 for (auto& key : ClearKeyState::singleton().keys().values()) 488 allKeys.appendVector(key); 489 490 return allKeys; 491 } 492 483 493 void CDMInstanceClearKey::updateLicense(const String& sessionId, LicenseType, const SharedBuffer& response, LicenseUpdateCallback callback) 484 494 { … … 566 576 } 567 577 568 // Cache the key information Vector on CDMInstance for easier access from the pipeline.569 m_keys = keyVector;570 571 578 dispatchCallback(false, WTFMove(changedKeys), SuccessValue::Succeeded); 572 579 return; … … 577 584 // FIXME: Retrieve the key ID information and use it to validate the keys for this sessionId. 578 585 ClearKeyState::singleton().keys().remove(sessionId); 579 m_keys.clear();580 586 dispatchCallback(true, std::nullopt, SuccessValue::Succeeded); 581 587 return; -
trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h
r224707 r227409 103 103 }; 104 104 105 const Vector<Key> & keys() const { return m_keys; }105 const Vector<Key> keys() const; 106 106 107 107 private: 108 108 WeakPtrFactory<CDMInstanceClearKey> m_weakPtrFactory; 109 Vector<Key> m_keys;110 109 }; 111 110
Note: See TracChangeset
for help on using the changeset viewer.