Querying robustnesslevel from CDM instead of hardcoding the levels. - #1715
Querying robustnesslevel from CDM instead of hardcoding the levels.#1715kkanag314 wants to merge 2 commits into
Conversation
a59219e to
9d4da06
Compare
eocanha
left a comment
There was a problem hiding this comment.
Thanks for your contribution, Krishna.
It would be nice to explain briefly the purpose of the patch in the PR description. That would help me to understand its rationale and review it in a more efficient way.
Also, please join both commits in a single one and write a commit message that explains a bit what the purpose of the commit is and what it does. You can use git rebase -i b5686e7^ (that's the previous commit to the first one in the branch) and mark the second commit of the branch as "f" (fix) of the first one.
Thank you so much.
9d4da06 to
c2149eb
Compare
eocanha
left a comment
There was a problem hiding this comment.
The PR looks good. I'm going to submit it upstream and then backport it when it's approved.
I'm also going to add a modification that I'm explaining inline below. It's not required that you resubmit any changes. I'm taking care of that.
| } | ||
| } | ||
| } | ||
| if (buffer != nullptr) |
There was a problem hiding this comment.
I'll do the same change here and write it as if (buffer).
| uint16_t count = 0; | ||
|
|
||
| OpenCDMError error = opencdm_system_supported_robustness(m_thunderSystem.get(), &buffer, &count); | ||
| if (error == ERROR_NONE && buffer != nullptr && count > 0) { |
There was a problem hiding this comment.
I'm going to adapt the buffer != nullptr condition to the WebKit Code Style Guidelines and rewrite it as buffer (which evaluates to true when the pointer is not null) when I submit the patch upstream.
| Vector<AtomString> CDMPrivateThunder::supportedRobustnesses() const | ||
| { | ||
| return { emptyAtom(), "SW_SECURE_DECODE"_s, "SW_SECURE_CRYPTO"_s }; | ||
| static const Vector<AtomString> defaultRobustnesses = { emptyAtom(), "SW_SECURE_DECODE"_s, "SW_SECURE_CRYPTO"_s }; |
There was a problem hiding this comment.
This needs to be a Vector<String> because the AtomString one can't be automatically converted to a String vector. I'll do the change here, don't worry.
Sorry, it's fine. I was looking at the upstream type, which is String.
|
This PR is a follow-up to PR #1715 , which introduced an OpenCDM API and corresponding WPEWebKit integration to query supported robustness levels directly from the CDM, addressing the concern raised in issue #1465 regarding hardcoded robustness values. This change adds fallback handling to preserve the existing WebKit behavior when the OpenCDM robustness query is unavailable or fails, ensuring backward compatibility while continuing to expose actual CDM capabilities whenever available. |
c2149eb to
bd41d2f
Compare
|
Bug submitted for upstream review as https://bugs.webkit.org/show_bug.cgi?id=322180 / WebKit/WebKit#72029. I had to do some extra changes and refactorings to take care of an unsafe buffer usage warning reported by clang, which doesn't like the pointer arithmetics required by |
|
Commit landed upstream as WebKit/WebKit@616b4d8 and was backported to wpe-2.46 as 54382f2. Closing PR. |
Query robustnesslevel from CDM instead of hardcoding the levels.
bd41d2f