Skip to content

Querying robustnesslevel from CDM instead of hardcoding the levels. - #1715

Open
kkanag314 wants to merge 2 commits into
WebPlatformForEmbedded:wpe-2.46from
kkanag314:ocdm-robustness
Open

Querying robustnesslevel from CDM instead of hardcoding the levels.#1715
kkanag314 wants to merge 2 commits into
WebPlatformForEmbedded:wpe-2.46from
kkanag314:ocdm-robustness

Conversation

@kkanag314

@kkanag314kkanag314 commented Aug 17, 2026

Copy link
Copy Markdown

Pull Request Template

File a Bug

All changes should be associated with a bug. The WebKit project is currently using Bugzilla as our bug tracker. Note that multiple changes may be associated with a single bug.

Provided Tooling

The WebKit Project strongly recommends contributors use Tools/Scripts/git-webkit to generate pull requests. See Setup and Contributing Code for how to do this.

Template

If a contributor wishes to file a pull request manually, the template is below. Manually-filed pull requests should contain their commit message as the pull request description, and their commit message should be formatted like the template below.

Additionally, the pull request should be mentioned on Bugzilla, labels applied to the pull request matching the component and version of the Bugzilla associated with the pull request and the pull request assigned to its author.

< bug title >
https://bugs.webkit.org/show_bug.cgi?id=#####
Reviewed by NOBODY (OOPS!).
Explanation of why this fixes the bug (OOPS!).
* path/changed.ext:
(function):
(class.function):

9d4da06

Build-TestsLayout-Tests
✅ 🛠 wpe-246-amd64-build✅ 🧪 wpe-246-amd64-layout
✅ 🛠 wpe-246-arm32-build✅ 🧪 wpe-246-arm32-layout

@kkanag314
kkanag314force-pushed the ocdm-robustness branch 3 times, most recently from ee86e7c to a59219eCompareAugust 18, 2026 12:50

@eocanhaeocanha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

if (buffer[i] != nullptr) {
robustnesses.append(AtomString::fromLatin1(buffer[i]));;
free(buffer[i]);
if (m_thunderSystem) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition (was better in its original !m_thunderSystem shape, because an early return is the preferred way to manage error cases in WebKit (when reasonable).

You can have a first "CDMPrivateThunder: No active OpenCDM system..." warning (not error) message about the check for no thunder system, and then a later "Failed to get robustness levels..." warning message to check for a successful robustness level retrieval. In both cases, you would need to return { emptyAtom(), "SW_SECURE_DECODE"_s, "SW_SECURE_CRYPTO"_s };. You can declare that default value as a constant that you can use from the two return places if you want.

if (buffer != nullptr) {
free(buffer);
}
if (buffer != nullptr) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of one-line "then" clauses in ifs and other control structures (this one and the other ones in the same overall block) shouldn't have braces, as per the WebKit coding style guide.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants

@kkanag314@eocanha@modeveci