Cherry pick PR #9191: cobalt: Unify H5vccSettings processing#10023
Cherry pick PR #9191: cobalt: Unify H5vccSettings processing#10023
Conversation
This PR is to avoid repeated code by introducing helper methods Introduce a ProcessLongAs template helper to consolidate redundant V8 type checking and promise rejection logic for boolean settings. This streamlines the validation and conversion of V8UnionLongOrString values, simplifying H5vccSettings::set and ProcessDecoderBufferSettings. It also standardizes promise handling. Issue: 480134029 (cherry picked from commit 095d4ff)
|
Caution There were merge conflicts while cherry picking! Check out cherry-pick-main-9191 and fix the conflicts before proceeding. Check the log at https://github.com/youtube/cobalt/actions/runs/24411079888 for details. |
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
There was a problem hiding this comment.
Code Review
This pull request refactors the H5vccSettings::set method by introducing template helpers for setting processing and adopting base::expected for error management. Review feedback highlights a missing LOG(WARNING) for unsupported DecoderBuffer. settings and recommends using constexpr constants instead of raw string literals to comply with Chromium style guidelines and maintain compile-time safety.
third_party/blink/renderer/modules/cobalt/h5vcc_settings/h_5_vcc_settings.cc
Show resolved
Hide resolved
third_party/blink/renderer/modules/cobalt/h5vcc_settings/h_5_vcc_settings.cc
Show resolved
Hide resolved
johnedocampo
left a comment
There was a problem hiding this comment.
Overall, transfer from m114 to m138 looks good. Left some comments.
third_party/blink/renderer/modules/cobalt/h5vcc_settings/h_5_vcc_settings.cc
Outdated
Show resolved
Hide resolved
third_party/blink/renderer/modules/cobalt/h5vcc_settings/h_5_vcc_settings.cc
Show resolved
Hide resolved
|
Is it also possible to update the PR description with a small list of differences between this CP and the original commit? Something like: |
Make sense. Done |
…ngs processing Refer to original PR: #10023 Refer to the original PR: #9191 This PR is to avoid repeated code by introducing helper methods Introduce a ProcessLongAs template helper to consolidate redundant V8 type checking and promise rejection logic for boolean settings. This streamlines the validation and conversion of V8UnionLongOrString values, simplifying H5vccSettings::set and ProcessDecoderBufferSettings. It also standardizes promise handling. Issue: 480134029 ---- Differences From The Original PR: - Added connection for DecommitableAllocatorStrategy. This makes cherry-picking #9462 unnecessary. - We cannot use `SettingContext` as the original commit does. main branch does not allow getting raw pointer to garbage-collectable memory - Help method takes a callback method returning boolean, since on main, we have to handle non-starboard build --------- Co-authored-by: Kyujung Youn <kjyoun@google.com> (cherry picked from commit d70c34a)

Refer to the original PR: #9191
This PR is to avoid repeated code by introducing helper methods
Introduce a ProcessLongAs template helper to consolidate
redundant V8 type checking and promise rejection logic for boolean
settings. This streamlines the validation and conversion of
V8UnionLongOrString values, simplifying H5vccSettings::set and
ProcessDecoderBufferSettings. It also standardizes promise handling.
Issue: 480134029
Differences From The Original PR:
SettingContextas the original commit does. main branch does not allow getting raw pointer to garbage-collectable memory