Skip to content

Cherry pick PR #9191: cobalt: Unify H5vccSettings processing#10023

Merged
kjyoun merged 4 commits intomainfrom
cherry-pick-main-9191
Apr 14, 2026
Merged

Cherry pick PR #9191: cobalt: Unify H5vccSettings processing#10023
kjyoun merged 4 commits intomainfrom
cherry-pick-main-9191

Conversation

@cobalt-github-releaser-bot
Copy link
Copy Markdown
Collaborator

@cobalt-github-releaser-bot cobalt-github-releaser-bot commented Apr 14, 2026

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 media: Reconnect decommitable strategy to H5VCC #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

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)
@cobalt-github-releaser-bot
Copy link
Copy Markdown
Collaborator Author

MERGE CONFLICT CAT

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.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Unify H5vccSettings processing

Introduce template helpers to consolidate redundant V8 type checking,
validation, and promise rejection logic within H5vccSettings. This
streamlines the set method and standardizes promise handling, reducing
code duplication.

Bug: 480134029

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@kjyoun kjyoun marked this pull request as ready for review April 14, 2026 19:30
@kjyoun kjyoun requested a review from a team as a code owner April 14, 2026 19:30
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@kjyoun kjyoun requested review from johnedocampo and removed request for kjyoun April 14, 2026 19:38
Copy link
Copy Markdown
Contributor

@johnedocampo johnedocampo left a comment

Choose a reason for hiding this comment

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

Overall, transfer from m114 to m138 looks good. Left some comments.

@johnedocampo
Copy link
Copy Markdown
Contributor

Is it also possible to update the PR description with a small list of differences between this CP and the original commit? Something like:

Differences From The Original PR:

- Added connection for DecommitableAllocatorStrategy. This makes <PATCH PR> unecessary.
- Anything else that may be worth mentioning in the change

@kjyoun
Copy link
Copy Markdown
Contributor

kjyoun commented Apr 14, 2026

Is it also possible to update the PR description with a small list of differences between this CP and the original commit? Something like:

Differences From The Original PR:

- Added connection for DecommitableAllocatorStrategy. This makes <PATCH PR> unecessary.
- Anything else that may be worth mentioning in the change

Make sense. Done

@kjyoun kjyoun requested a review from johnedocampo April 14, 2026 20:54
@kjyoun kjyoun enabled auto-merge (squash) April 14, 2026 20:57
@kjyoun kjyoun merged commit d70c34a into main Apr 14, 2026
791 of 873 checks passed
@kjyoun kjyoun deleted the cherry-pick-main-9191 branch April 14, 2026 23:18
@github-actions github-actions bot added the cp-27.lts Cherry Pick to the 27.lts branch label Apr 14, 2026
cobalt-github-releaser-bot added a commit that referenced this pull request Apr 14, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp-27.lts Cherry Pick to the 27.lts branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants