Skip to content

Autoroll from main to 27.lts - #11578

Merged
briantting merged 3 commits into
27.ltsfrom
autoroll-main-to-27.lts
Jul 28, 2026
Merged

Autoroll from main to 27.lts#11578
briantting merged 3 commits into
27.ltsfrom
autoroll-main-to-27.lts

Conversation

@cobalt-github-releaser-bot

@cobalt-github-releaser-bot cobalt-github-releaser-bot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

xiaomings and others added 2 commits July 28, 2026 20:31
Refer to original PR: #11550

Add support for a page alignment flag in DecoderBufferAllocator to
control OS block allocation alignment. This allows for more granular
memory management when using the configurable decommit strategy.

Implement a lockless optimization during suspend by checking an atomic
flag before acquiring the allocator mutex. This prevents unnecessary
blocking of the UI thread when decommit on suspend is not enabled.

Additionally, simplify pointer arithmetic in StarboardMemoryAllocator
using uint8_t pointers and update H5vcc settings to expose the new
alignment configuration bit.

Bug: 454441375

(cherry picked from commit 8ac74bd)
…ng shutdown (#11376)"

Refer to original PR: #11564

This reverts commit 25cef17.
This reverts commit 42cace2.

Issue: 534798847

(cherry picked from commit 00d5d7b)
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Roll main to 27.lts

Automated cherry-pick roll of changes from main to the 27.lts branch,
incorporating updates from pull requests 11550 and 11564.

This update simplifies the Android shutdown logic to improve restart
reliability and enhances the decoder buffer allocator with new
configuration options for page alignment and memory decommitting
to optimize overall system resource usage.

Bug: 11578

💡 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

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

Copy link
Copy Markdown
Contributor

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 removes the MediaResourceTracker utility and the kWaitForMediaResourcesOnShutdown feature across Android Starboard media components, and introduces a page alignment configuration (allocate_with_page_alignment) to the decoder buffer allocator strategy and StarboardMemoryAllocator. A critical bug was identified in JavaSwitches.java where generating separate --enable-features and --disable-features arguments for each switch will cause only the last occurrence to be preserved by base::CommandLine, silently ignoring the others. It is recommended to revert this change and continue joining the features with commas into single arguments.

Comment on lines 102 to 108
if (javaSwitches.containsKey(JavaSwitches.USE_IPV4_FOR_DNS)) {
enabledFeatures.add("UseIPv4ForDNS");
extraCommandLineArgs.add("--enable-features=UseIPv4ForDNS");
}

if (javaSwitches.containsKey(JavaSwitches.LOCAL_STORAGE_DELETE_LOCK_FILE)) {
enabledFeatures.add("LocalStorageDeleteLockFile");
extraCommandLineArgs.add("--enable-features=LocalStorageDeleteLockFile");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Critical Bug: Multiple --enable-features and --disable-features arguments are overwritten

In Chromium and Cobalt, base::CommandLine parses command-line arguments into a map where each switch key can only have a single value. If a switch like --enable-features or --disable-features is specified multiple times on the command line, only the last occurrence's value is preserved, and all previous ones are overwritten and ignored.

By changing the code to append separate --enable-features=... arguments for each feature instead of joining them with a comma into a single --enable-features argument, only the last enabled feature in the list will actually be enabled. All other features will be silently ignored.

Suggested Fix

Revert this change and continue to collect all enabled/disabled features using a StringJoiner (or List<String>) and append a single --enable-features=... and --disable-features=... argument to extraCommandLineArgs at the end of the method, for example:

public static List<String> getExtraCommandLineArgs(Map<String, String> javaSwitches) {
    List<String> extraCommandLineArgs = new ArrayList<>();
    StringJoiner jsFlags = new StringJoiner(";");
    StringJoiner enabledFeatures = new StringJoiner(",");
    StringJoiner disabledFeatures = new StringJoiner(",");

    if (javaSwitches.containsKey(JavaSwitches.USE_IPV4_FOR_DNS)) {
        enabledFeatures.add("UseIPv4ForDNS");
    }
    // ... collect other features ...

    if (enabledFeatures.length() > 0) {
        extraCommandLineArgs.add("--enable-features=" + enabledFeatures.toString());
    }
    if (disabledFeatures.length() > 0) {
        extraCommandLineArgs.add("--disable-features=" + disabledFeatures.toString());
    }
    return extraCommandLineArgs;
}

Refer to original PR: #11335

SIGUSR1 is intercepted by the Android runtime and never reaches the
handler installed by the test. Switch the test to SIGUSR2.

Bug: 532068409

(cherry picked from commit b6c1a9d)
@briantting
briantting merged commit 48e0f02 into 27.lts Jul 28, 2026
136 of 142 checks passed
@briantting
briantting deleted the autoroll-main-to-27.lts branch July 28, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants