Web pages: browsers are made at once, so none outlives its view (M-12)

make_browsers creates each browser synchronously and adopts it in the
same call, so no view waits on a browser: it leaves before creation
(skipped) or has a browser to close. The late-close branch in
on_after_created is gone. webprobe drops 5 views before the pump and
10 within 27 ms; webview.sh wants all 35 freed before the hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 13:47:45 -04:00
1 parent c5cb153f72
commit 0d4dd64640
10 files changed
+50 -24

No files matched your search

+11 -4
View File
@@ -201,7 +201,8 @@ fn make_browsers() {
windowless_frame_rate: 60,
..Default::default()
};
let made = browser_host_create_browser(
// Made at once: no view ever waits on a browser.
let made = browser_host_create_browser_sync(
Some(&info),
Some(&mut handlers::client(&surface)),
Some(&url.as_str().into()),
@@ -209,9 +210,15 @@ fn make_browsers() {
None,
None,
);
if made != 1 {
surface.lock().expect("the surface lock").failed =
Some(format!("CEF made no browser for {url}"));
match made {
Some(browser) => {
handlers::adopt(&browser, surface.clone());
surface.lock().expect("the surface lock").browser = Some(browser);
}
None => {
surface.lock().expect("the surface lock").failed =
Some(format!("CEF made no browser for {url}"))
}
}
}
}