Repository navigation
Fix setWindowVisibility() being a no-op for OSR/windowless browsers - #41
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41 +/- ##
============================================
+ Coverage 38.01% 38.04% +0.02%
- Complexity 735 736 +1
============================================
Files 243 244 +1
Lines 14863 14881 +18
Branches 2449 2451 +2
============================================
+ Hits 5650 5661 +11
- Misses 8011 8014 +3
- Partials 1202 1206 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1 of 2 tasks
Thrameos
added a commit
that referenced
this pull request
Sep 5, 2026
preliminary update racing ahead of onBeforeDownload CefDownloadItemTest.cancelDuringDownloadInvokesNCancel() flaked intermittently in CI across multiple unrelated backport PRs (#38, #39, #41, #42), always failing the same assertion: "onBeforeDownload was never invoked". Root-caused by reproducing it locally (100% deterministic once a low-risk, narrowly-scoped repro was possible -- see PR #44's run_tests.sh fix, needed first to run just this one test without also running the whole suite + leak-sweep) and adding temporary native fprintf instrumentation (not included in this commit) at DownloadHandler::OnBeforeDownload/ OnDownloadUpdated and ClientHandler::GetDownloadHandler. That instrumentation showed CEF can deliver a preliminary OnDownloadUpdated() notification -- for a valid, real CefDownloadItem -- *before* OnBeforeDownload() has been dispatched to the handler at all. This test's onDownloadUpdated() used to treat "not complete" on the very first update it saw as "must actively cancel it", immediately calling callback.cancel() and terminateTest() -- racing ahead of onBeforeDownload and ending the test before it ever got a chance to run, which is exactly what "onBeforeDownload was never invoked" captures. Fix: ignore any onDownloadUpdated() notification that arrives before this handler's own onBeforeDownload() has recorded its decision (gotBeforeDownload[0]). Verified via direct reproduction: failed 3/3 in isolation before the fix (including against a heavily-used local CEF profile where it failed 100% of the time), passed cleanly every time after (5+ consecutive solo runs, plus the full class together) with no change to downloadCompletesAndWritesRealFile's behavior. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
N_SetWindowVisibility's whole body was gated on OS_MACOSX, and even there only ran when windowed (IsWindowRenderingDisabled() check was backwards for that macOS branch's intent) -- so on every platform, for every OSR browser (useOSR=true, which is nearly all of ours), setWindowVisibility() has always silently done nothing. Windowless browsers have no native window for the OS-level toggle; CefBrowserHost::WasHidden() is CEF's own signal for this case (pauses/resumes rendering and GPU resource usage). Found by mining DanielTM999/java-cef (a sibling fork of chromiumembedded/java-cef), commit 6bd0cca ("OSR: WasHidden on setWindowVisibility for windowless browsers") -- confirmed the same bug exists here and adapted the fix. Adds CefBrowserWindowVisibilityTest as smoke coverage (the internal paused/resumed rendering state isn't observable from the Java side, so this asserts non-throwing rather than the rendering-pause effect directly). Verified against a full local suite run: 124/124 passing. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
Thrameos
force-pushed
the
backport/window-visibility-osr
branch
from
September 5, 2026 21:23
deaf65b to
8978d5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
N_SetWindowVisibility's whole body was gated onOS_MACOSX, and even there only ran when windowed (theIsWindowRenderingDisabled()check was backwards for that branch's intent) -- so on every platform, for every OSR browser (useOSR=true, nearly all of ours),setWindowVisibility()has always silently done nothing.CefBrowserHost::WasHidden()is CEF's own signal for this case (pauses/resumes rendering and GPU resource usage).DanielTM999/java-cef(a sibling fork ofchromiumembedded/java-cef), commit6bd0cca1("OSR: WasHidden on setWindowVisibility for windowless browsers") -- confirmed the same bug exists here and adapted the fix.Test plan
CefBrowserWindowVisibilityTestas smoke coverage -- the internal paused/resumed rendering state isn't observable from the Java side, so this asserts non-throwing rather than the rendering-pause effect directly.libjcef.socleanly (ninja jcef), zero compile errors.Small, focused backport of a single self-contained fix (no other changes bundled in), following the same shape as PR #1, #36-#40.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq