[EME] ClearKey: list 'persistent-license' sessions as supported
Created attachment 320873 [details] Patch
Attachment 320873 [details] did not pass style-queue: ERROR: Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:186: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:210: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 320873 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320873&action=review > Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:212 > + // Reject any configuration that marks persistent state as required, unless > + // the 'persistent-license' session type has to be supported. > + auto& sessionTypes = configuration.sessionTypes; > + bool supportsPersistentLicenseSession = std::any_of(sessionTypes.begin(), sessionTypes.end(), > + [] (auto& sessionType) { return sessionType == CDMSessionType::PersistentLicense; }); > + if (configuration.persistentState == CDMRequirement::Required && !supportsPersistentLicenseSession) > return false; This piece of code is the same as in the other function, right? It could make sense to refactor it into a private method.
Created attachment 320882 [details] Patch
Attachment 320882 [details] did not pass style-queue: ERROR: Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:179: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 320882 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320882&action=review > Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:190 > + // Reject any configuration that marks persistent state as required, unless > + // the 'persistent-license' session type has to be supported. > + if (configuration.persistentState == CDMRequirement::Required && !containsPersistentLicenseType(configuration.sessionTypes)) You could have gone further, pass the configuration and check the persistent state to be required and if the vector contains a persistent session.
Comment on attachment 320882 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320882&action=review >> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:190 >> + if (configuration.persistentState == CDMRequirement::Required && !containsPersistentLicenseType(configuration.sessionTypes)) > > You could have gone further, pass the configuration and check the persistent state to be required and if the vector contains a persistent session. IMO that would reduce clarity, and it would remove the similarity with the distinctiveIdentifier check.
Committed r222085: <http://trac.webkit.org/changeset/222085>
<rdar://problem/34693298>