Uh oh!
There was an error while loading. Please reload this page.
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
ee86e7c to
a59219eComparea59219e to
9d4da06Compare
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.
| if (buffer[i] != nullptr) { | ||
| robustnesses.append(AtomString::fromLatin1(buffer[i]));; | ||
| free(buffer[i]); | ||
| if (m_thunderSystem) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
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-webkitto 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.
9d4da06